checking node name with attribute

Nastevelt

New Member
how to find if a node exists with the attribute value using xslt?suppose if my xml like this\[code\]<root> <sub> <p>text</p> <title id='id1-num-444'>text</title> <p>text</p> <title id='id1-str-aaa'>text</title> <p>text</p> <title id='id1-num-333'>text</title> <p>text</p> </sub></root>\[/code\]i used the following xsl\[code\]<xsl:template match ="sub"> ....some tags... <xsl:if test ="contains(name(), 'title[@id='id1-num']')"> <xsl:call-template name ="title"></xsl:call-template></xsl:if></xsl:template>\[/code\]The if condition need to check till num, it shouldn't consider anything after num.Thanks.
 
Back
Top