Biztalk映射创建重复的目标节点

Biztalk映射创建重复的目标节点,biztalk,biztalk-mapper,Biztalk,Biztalk Mapper,使用biztalk mapper,我需要复制目标节点。。我已经创建了我的问题的简化版本。请参阅下面的映射链接了解源和目标架构。。。对不起,没有足够的点数来发布图片 我需要为每个OptionNotes复制目标选项节点。OptionNotes的值将被管道(“|”)分割,然后映射到目标代码和描述 输入如下: <ns0:Source xmlns:ns0="http://Test.SOAP.Source1"> <Option> <OptionID>ID0_N

使用biztalk mapper,我需要复制目标节点。。我已经创建了我的问题的简化版本。请参阅下面的映射链接了解源和目标架构。。。对不起,没有足够的点数来发布图片

我需要为每个OptionNotes复制目标选项节点。OptionNotes的值将被管道(“|”)分割,然后映射到目标代码和描述

输入如下:

<ns0:Source xmlns:ns0="http://Test.SOAP.Source1">
  <Option>
    <OptionID>ID0_NoNotes</OptionID>
    <OptionName>OptionName_0</OptionName>
  </Option>
  <Option>
    <OptionID>ID1_NoNotes</OptionID>
    <OptionName>OptionName_1</OptionName>
    <OptionNotes>NOTE1|BLAH1</OptionNotes>
    <OptionNotes>NOTE2|BLAH2</OptionNotes>
  </Option>  
</ns0:Source>
<Destination>
    <Options>
        <Option>
            <Code>ID0_NoNotes</Code>
            <Description>OptionName_0</Description>
        </Option>
        <Option>
            <Code>ID1_NoNotes</Code>
            <Description>OptionName_1</Description>
        </Option>
        <Option>
            <Code>NOTE1</Code>
            <Description>BLAH1</Description>
        </Option>
        <Option>
            <Code>NOTE2</Code>
            <Description>BLAH2</Description>
        </Option>       
    </Options>
</Destination>
<xsl:for-each select="ns0:Source/Option">
<Option>
<xsl:for-each select="OptionID">
<Code>
<xsl:value-of select="string(.)"/>
</Code>
</xsl:for-each>
<xsl:for-each select="OptionName">
<Description>
<xsl:value-of select="string(.)"/>
</Description>
</xsl:for-each>
</Option>
</xsl:for-each>
<xsl:for-each select="ns0:Source/Option/OptionNotes">
<xsl:variable name="var1_resultof_cast" select="string(.)"/>
<Option>
<Code>
<xsl:value-of select="substring-before($var1_resultof_cast, '|')"/>
</Code>
<Description>
<xsl:value-of select="substring-after($var1_resultof_cast, '|')"/>
</Description>
</Option>
</xsl:for-each>
尝试使用循环和与值映射的组合,但无效。我必须求助于你吗
内联xslt?

我们使用了Mapforce,它很容易做到这一点。然后,我们获取XSLT并将其作为内联XSLT脚本functoid的一部分导入

产生的XSLT如下所示:

<ns0:Source xmlns:ns0="http://Test.SOAP.Source1">
  <Option>
    <OptionID>ID0_NoNotes</OptionID>
    <OptionName>OptionName_0</OptionName>
  </Option>
  <Option>
    <OptionID>ID1_NoNotes</OptionID>
    <OptionName>OptionName_1</OptionName>
    <OptionNotes>NOTE1|BLAH1</OptionNotes>
    <OptionNotes>NOTE2|BLAH2</OptionNotes>
  </Option>  
</ns0:Source>
<Destination>
    <Options>
        <Option>
            <Code>ID0_NoNotes</Code>
            <Description>OptionName_0</Description>
        </Option>
        <Option>
            <Code>ID1_NoNotes</Code>
            <Description>OptionName_1</Description>
        </Option>
        <Option>
            <Code>NOTE1</Code>
            <Description>BLAH1</Description>
        </Option>
        <Option>
            <Code>NOTE2</Code>
            <Description>BLAH2</Description>
        </Option>       
    </Options>
</Destination>
<xsl:for-each select="ns0:Source/Option">
<Option>
<xsl:for-each select="OptionID">
<Code>
<xsl:value-of select="string(.)"/>
</Code>
</xsl:for-each>
<xsl:for-each select="OptionName">
<Description>
<xsl:value-of select="string(.)"/>
</Description>
</xsl:for-each>
</Option>
</xsl:for-each>
<xsl:for-each select="ns0:Source/Option/OptionNotes">
<xsl:variable name="var1_resultof_cast" select="string(.)"/>
<Option>
<Code>
<xsl:value-of select="substring-before($var1_resultof_cast, '|')"/>
</Code>
<Description>
<xsl:value-of select="substring-after($var1_resultof_cast, '|')"/>
</Description>
</Option>
</xsl:for-each>






谢谢大家。

(我对BizTalk一无所知。)为什么不使用XSLT转换XML?这就是它的用途。作为一个狂热的BizTalker,我从不使用映射器,总是使用XSLT,但问题再次出现在映射器上,而不是如何在XSLT中使用它。@Pietervandenheade为什么要标记XSLT?好的,没有看到这个,我站出来更正。@michael.hor257k抱歉,我认为这涉及XSLT。我将删除xslt标记。