I need to convert this xml using XSLT using Identity Transformation like
<a>
<b>
<x1>Computer Science<x1>
<x2>New York</x2>
</b>
<b>
<x1>MECHANICAL</x1>
<x2>FLORIDA</x2>
</b>
<c></c>
</a>
Whenever i tried i used to get like below...
<a>
<b>
<x1>Computer Science<x1>
<x2>New York</x2>
</b>
<b>
<x1>Computer Science</x1>
<x2>New York</x2>
</b>
<c></c>
</a>
Subject:Identity Transformation in XSL !! Pleas help me.. Author:(Deleted User) Date:07 Feb 2007 06:44 AM
Prya,
first of all, beware that the XSLT you pasted is not well-formed (the template for "a/b/x1" is missing the closing </xsl:choose></xsl:template>).
The error in your code is in the xsl:when instructions, where they test the full path "a/b/x1='CS'": being inside a template matching "a/b/x1" (or "a/b/x2") the context is already the x1 or x2 node, so you should change them to do <xsl:when test=".='CS'">, <xsl:when test=".='MECH'">, <xsl:when test=".='NY'">, <xsl:when test=".='FL'">.