I am trying to get the name of the next element name using a common Xpath and a generic XSL. But unable to get the name of the element.
Input 1:
<test>
<userId>we</userId>
<userId1>
<testy:tool/>
</userId1>
</test>
Input 2:
<test>
<userId>we</userId>
<userId1>
<testy:hammer/>
</userId1>
</test>
Xsl I am using:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0"
>
<xsl:template match="operationName">
<xsl:value-of select="local-name(/test/userId1)"/>
<xsl:apply-templates select="local-name(/test/userId1)" mode="next"/>
</xsl:template>
<xsl:template match="testy" mode="next">
<xsl:value-of select="(following::testy | descendant::testy)[1]"/>
</xsl:template>
</xsl:stylesheet>
But this always displays the value of UserID. Can anyone point what am I doing wrong here?
Cheers!