通过 XML 拆装器管道组件、BizTalk 框架拆装器管道组件或平面文件拆装器管道组件,可将架构中定义的可分辨字段写入消息上下文中,格式如下:
使用的名称 是 XPath 中的可分辨字段
命名空间 URI 为 http://schemas.microsoft.com/BizTalk/2003/btsDistinguishedFields
属性的值是使用指定的 XPath 从 XML 文档中提取的 System.String 值。
下面的示例架构具有可分辨字段 Price:
<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns="http://SendHtmlMessage.PO" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://SendHtmlMessage.PO xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="PO">
<xs:annotation>
<xs:appinfo>
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='PO' and namespace-uri()='http://SendHtmlMessage.PO']/*[local-
name()='Price' and namespace-uri()='']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Item" type="xs:string" />
<xs:element name="Price" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
对于文档实例
<PO>
<Item>Bolt</Item>
<Price>10</Price>
<PO>
XML 拆装器在消息上下文中写入可分辨字段,如下如示:
上下文中属性的名称: "/*[local-name()='PO' and namespace-uri()='http://SendHtmlMessage.PO']/\*[local-name()='Price' and namespace-uri()='']"
属性的命名空间: http://schemas.microsoft.com/BizTalk/2003/btsDistinguishedFields
属性的值:10
注意
如果任何 XML 文档元素值的大小超过 85 KB,则处理这些文档时性能可能会降低。