my XML is -
<app>
<data>
<lang>en</lang>
</data>
</app>
I want to check, whether 'lang' tag/element is present or not. I am using below code to check it, but I think it is not working. -
<xsl:if test="app/data/lang">
<xsl:call-template name="xyz" /></xsl:if>
I am not able to understand what I am doing wrong here. I referred this page of stackoverflow. Please suggest any other way do solve this. Thanks in advance!
Answer -
After doing many changes I got one solution. I made a small change to solve this issue. I added '/' before 'app'.
<xsl:if test="/app/data/lang">
<xsl:call-template name="xyz" />
</xsl:if>
Thanks everyone for sharing their solutions.