rnv 0 Posted February 27, 2013 Report Share Posted February 27, 2013 Hi, I have to find an attribute value of an element based on its another attribute. example xml: <catalog> <cd id="1" title="xxx" related="3"> <artist>Bob Dylan</artist> </cd> <cd id="2" title="xxx" related="1"> <artist>xxxx</artist> </cd></catalog> for example when parsing through the second node i got the related item specified by the attribute (related="1"). Based on this value I need to get the title of the CD. that is - Find the element CD with id="1"- get the title of that element I am able to get the element using the following xpath: <xsl:template name="get-title-from-id"> <xsl:param name="id" /> <xsl:value-of select="//catalog/cd[@id=1]"/></xsl:template> but how do I get the title? will really appreciate regards,rnv Quote Link to post Share on other sites
rnv 0 Posted February 27, 2013 Author Report Share Posted February 27, 2013 Thanks I got it Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.