I have following xml
<myRequest>
<id>123456789</id>
</myRequest>
I have the following xslt not working to get the same as output
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" indent="yes" encoding="ISO-8859-1" version="1.0"
omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="myRequest">
<myRequest>
<xsl:apply-templates select="id"/>
</myRequest>
</xsl:template>
<xsl:template match="id">
<customerId>
<xsl:value-of select="id"/>
</customerId>
</xsl:template>
</xsl:stylesheet>
working xslt
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" indent="yes" encoding="ISO-8859-1" version="1.0"
omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="myRequest">
<myRequest>
<xsl:apply-templates select="//id"/>
</myRequest>
</xsl:template>
<xsl:template match="id">
<customerId>
<xsl:value-of select="//id"/>
</customerId>
</xsl:template>
</xsl:stylesheet>
I put current() in the XWatch,it is also not showing any thing when debug pointer is in
<xsl:template match="myRequest">
<myRequest>
..........................
Why i need to use // here ?Because id element is directly under myRequest.I really got confused using // here?
Without using // also we need to get the output.
What the mistake i am doing here ?
Thanks in advance...