Map 在biztalk 2009中将结构映射到集合
我的输入类似于:Map 在biztalk 2009中将结构映射到集合,map,biztalk,biztalk-2009,Map,Biztalk,Biztalk 2009,我的输入类似于: <Person> <FirstName>abc</FirstName> <Bsn>2345467</Bsn> <Person> abc 2345467 输出应为: <Person> <properties> <property> <propertyname> Firstname </propertyname>
<Person>
<FirstName>abc</FirstName>
<Bsn>2345467</Bsn>
<Person>
abc
2345467
输出应为:
<Person>
<properties>
<property>
<propertyname> Firstname </propertyname>
<propertyValue> abc </propertyValue>
</property>
<property>
<propertyname> Bsn</propertyname>
<propertyValue> 2345467 </propertyValue>
</property>
</properties>
</Person>
名字
abc
Bsn
2345467
我的意思是目标没有特定的属性/属性。相反,它有一个属性集合,我在其中指定属性的名称和属性的值
非常感谢您的帮助
我正在使用Biztalk 2009
请帮助在这种情况下,我将使用自定义XSLT—使用或使用自定义XSLT文件替换整个映射(取决于其他映射的外观) 解决方案可能是这样的 XML
<Persons>
<Person>
<FirstName>abc</FirstName>
<Bsn>2345467</Bsn>
</Person>
</Persons>
abc
2345467
XSLT
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="Persons">
<Persons>
<xsl:apply-templates select="Person" />
</Persons>
</xsl:template>
<xsl:template match="Person">
<Person>
<properties>
<xsl:apply-templates select="*" mode="properties" />
</properties>
</Person>
</xsl:template>
<xsl:template match="node()" mode="properties">
<property>
<propertyname>
<xsl:value-of select="local-name()"/>
</propertyname>
<propertyvalue>
<xsl:value-of select="."/>
</propertyvalue>
</property>
</xsl:template>
</xsl:stylesheet>
结果
<?xml version="1.0" encoding="utf-8"?>
<Persons>
<Person>
<properties>
<property>
<propertyname>FirstName</propertyname>
<propertyvalue>abc</propertyvalue>
</property>
<property>
<propertyname>Bsn</propertyname>
<propertyvalue>2345467</propertyvalue>
</property>
</properties>
</Person>
</Persons>
名字
abc
Bsn
2345467
我尝试了循环和表格功能,但没有任何帮助!你好,Riri,谢谢你的回复!我可以用表循环functoid解决上述问题。但是,当我有一个更复杂的目标模式时,出现了一个转折。现在目标是这样的:[1]:意味着BSN要映射到扩展属性的Integer类型,而FirstName映射到扩展属性的StringType。我做不到!有什么想法吗?