XPath: how to select an element where the attribute value equals another element value



I have the following xml and trying to find all the link relations within: (xml snippet)



<heading nodeid="LINK_installing_driver">Installing the driver</heading>
...
<link linktotargetid="LINK_installing_driver">Installing the driver</link>


I can't just compare the attribute value strings, because I don't know them for sure. So I'll need a general XPath expression. I want the text of the heading whose nodeid matches the corresponding link element



<xsl:value-of select="heading[@nodeid = //link/@linktotargetid]"/>

No comments:

Post a Comment