Biztalk Maps: Grouping Different Nodes into a List

Is there a way to achieve the next conversion in a BT translator? if not, any smart idea?

<Person>
<Age>25</Age>
<Name>Paul</Name>
</Person>

at

<Person>
<CustomProperties>
<CustomProperty>
<Name>Age</Name>
<Value>25</VAlue>
</CustomProperty>
<CustomProperty>
<Name>Name</Name>
<Value>Paul</VAlue>
</CustomProperty>
</CustomProperties>

I need to collect some elements in the list of nodes.

Thanks in advance.

+3
source share
3 answers

I don't know much about the BizTalk linker, but the required XSLT will be pretty straight forward:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="Person">
    <xsl:copy>
      <CustomProperties>
        <xsl:apply-templates select="*" />
      </CustomProperties>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="Person/*">
    <CustomProperty>
      <Name><xsl:value-of select="name()" /></Name>
      <Value><xsl:value-of select="." /></Value>
    </CustomProperty>
  </xsl:template>
</xsl:stylesheet>
+2
source

You can also use the functoids TableLooping / TableExtractor on your map to create destination nodes.

See this post for an example:

http://hestia.typepad.com/flatlander/2007/01/mapping_fixed_e.html

+3
source

It looks like you have a direct mapping from input to output. When you do your mapping, right-click on the line taken from input to output. Select "Properties." There are options to either copy the input value of the node or the input name of the node. You can use two mappings from each child node, one for extracting a name and for a value.

0
source

Source: https://habr.com/ru/post/1741475/


All Articles