Creating nodes using Inline XSLT often eliminates much of the complexity around mapping. To demonstrate how to use XSLT, this post will illustrate an XSLT script that created three N1 target records using two “dynamic” input records and one “static” record.
The input has two out of the three records, the third record is hard coded into the XSLT.
The Map looks as follows:

The Map
<xsl:element name=”ns0:N1″>
<xsl:element name=”N101″><xsl:value-of select=”*[local-name()='IDCode']“/></xsl:element>
<xsl:element name=”N102″><xsl:value-of select=”*[local-name()='TPKnownAs']“/></xsl:element>
<xsl:element name=”N103″>9</xsl:element>
<xsl:element name=”N104″><xsl:value-of select=”*[local-name()='TPDUNS']“/></xsl:element>
</xsl:element>
</xsl:for-each>
<xsl:element name=”ns0:N1″>
<xsl:element name=”N101″>SF</xsl:element>
<xsl:element name=”N102″>STATIC TRADING PARTNER NAME, INC.</xsl:element>
<xsl:element name=”N103″>9</xsl:element>
<xsl:element name=”N104″>012345697654</xsl:element>
</xsl:element>
* Note that the value-of XSL is looking for “local-name()”. This enables source documents with namespace prefixes (such as ns0) in them to be mapped. In this case, the source is <ns0:TradingPartner>.



