XSLT Script:
<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var s0" version="1.0" xmlns:s0="http://ICAPOC.Orders" xmlns:ns0="http://ICAPOC.Delivaries">
<xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
<xsl:template match="/">
<xsl:apply-templates select="/s0:Orders" />
</xsl:template>
<xsl:template match="/s0:Orders">
<xsl:variable name="var:v1" select="Products/Product[1]/ID/text()" />
<xsl:variable name="var:v2" select="Products/Product[1]/Name/text()" />
<xsl:variable name="var:v3" select="Products/Product[1]/Details/text()" />
<xsl:variable name="var:v4" select="Products/Product[2]/ID/text()" />
<xsl:variable name="var:v5" select="Products/Product[2]/Name/text()" />
<xsl:variable name="var:v6" select="Products/Product[2]/Details/text()" />
<ns0:Delivaries>
<INDIA>
<Product>
<ID>
<xsl:value-of select="$var:v1" />
</ID>
<Name>
<xsl:value-of select="$var:v2" />
</Name>
<Details>
<xsl:value-of select="$var:v3" />
</Details>
</Product>
</INDIA>
<USA>
<Product>
<ID>
<xsl:value-of select="$var:v4" />
</ID>
<Name>
<xsl:value-of select="$var:v5" />
</Name>
<Details>
<xsl:value-of select="$var:v6" />
</Details>
</Product>
</USA>
</ns0:Delivaries>
</xsl:template>
</xsl:stylesheet>

No comments:
Post a Comment