【问题标题】:BizTalk Map Value Mapping Looping FunctoidsBizTalk 映射值映射循环 Functoids
【发布时间】:2012-03-31 22:18:02
【问题描述】:

我有一个源模式,其中地址可以作为多个“AddressLine”元素或多个“Street”元素或组合给出。我的目标架构只有多个“街道”元素。我在用 functoids 映射它时遇到了麻烦(自定义 XSLT 没有问题,但我宁愿使用这个映射的图形方法)。我已经尝试将两个源元素映射到一个循环functoid,然后将其映射到目标元素,但这只会产生循环通过源“AddressLine”和“Street”元素但不向目标写入任何内容的XSLT!

我已将源架构和目标架构的相关部分粘贴在下面:

来源

<xsd:complexType name="Address">
    <xsd:sequence>
        <xsd:element name="AddressLine" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
            <xsd:annotation>
                <xsd:documentation>Free format address lines may be used instead of (or in addition to) specific Street etc elements.</xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="Street" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="City" type="xsd:string" minOccurs="0"/>
        <xsd:element name="State" type="xsd:string" minOccurs="0">
            <xsd:annotation>
                <xsd:documentation>State/County/Province</xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="PostCode" type="xsd:string" minOccurs="0">
            <xsd:annotation>
                <xsd:documentation>Post/ZIP code</xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="Country" minOccurs="0">
            <xsd:complexType>
                <xsd:simpleContent>
                    <xsd:extension base="xsd:string">
                        <xsd:attribute name="Code" type="xsd:string" use="optional"/>
                        <xsd:attribute name="Codelist" type="xsd:string" use="optional"/>
                    </xsd:extension>
                </xsd:simpleContent>
            </xsd:complexType>
        </xsd:element>
    </xsd:sequence>
</xsd:complexType>

目的地

<xs:element name="Address" minOccurs="0">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="Street" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                                    <xs:element name="City" type="xs:string" minOccurs="0"/>
                                    <xs:element name="State" type="xs:string" minOccurs="0">
                                        <xs:annotation>
                                            <xs:documentation>State/County/Province</xs:documentation>
                                        </xs:annotation>
                                    </xs:element>
                                    <xs:element name="PostCode" type="xs:string" minOccurs="0">
                                        <xs:annotation>
                                            <xs:documentation>Post/ZIP code</xs:documentation>
                                        </xs:annotation>
                                    </xs:element>
                                    <xs:element name="Country" minOccurs="0">
                                        <xs:complexType>
                                            <xs:simpleContent>
                                                <xs:extension base="xs:string">
                                                    <xs:attribute name="Code" type="xs:string"/>
                                                </xs:extension>
                                            </xs:simpleContent>
                                        </xs:complexType>
                                    </xs:element>
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>

【问题讨论】:

  • 您是否希望将脚本功能与 .NET 方法一起使用,或者这基本上就像为您使用 XSLT 一样?就我个人而言,我认为在 .NET 中编码比在 XSLT 中更容易。
  • 我同意,恢复代码会更容易,但我想知道是否/如何使用 functoids 来完成。
  • 查看了表循环 och 表提取器? geekswithblogs.net/evankoch/archive/2007/08/07/114470.aspx

标签: biztalk biztalk-mapper


【解决方案1】:

您对循环 functoid 的链接仅定义循环结构。要在定义循环结构后获取实际数据,必须连接源节点和目标节点。

对于您的示例,在设计图面上放置一个循环 functoid。将 AddressLine 和 Street 从源连接到循环 functoid。然后将循环仿函数连接到目的地的街道。现在,将源中的 AddressLine 和 Street 直接连接到目标中的 Street。

希望这是有道理的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-04-01
    • 1970-01-01
    • 2013-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-12
    • 1970-01-01
    相关资源
    最近更新 更多