[xsl] Getting and using an xml attribute

Subject: [xsl] Getting and using an xml attribute
From: "Aaron Johnson" <artpunx@xxxxxxxxx>
Date: Fri, 30 Nov 2007 15:23:22 +0000

Is it possible to select an attribute, take its value and re-use it elsewhere?

I have some xml...the ID attribute value changes depending on user,
but the name attribute always stays the same. So it may look like

	<inactiveTab ID="1" name="Home"/>
        <inactiveTab ID="2" name="Away"/>
        <inactiveTab ID="3" name="Foo"/>
        <inactiveTab ID="4" name="Bar"/>

....or this....

	<inactiveTab ID="100" name="Home"/>
        <inactiveTab ID="200" name="Away"/>
        <inactiveTab ID="300" name="Foo"/>
        <inactiveTab ID="400" name="Bar"/>

Behind the scenes, urls are created automatically that incorporate the ID....


....or this....


...they contain the ID, but never the name.

I need to create a "manual" url, but because the ID value changes, I
need a way to "find out" what the ID value is first. I thought by
finding the element that contains name='Email, like this...


...I could then take the value of any ID attribute and then append it
to the end of my manual URL(...as a variable?). I would then always
(hopefully!) know that the manual url would look like the
automatically generated URL.

So, my question is, how do I capture the value of the ID attribute of
any element containing name="Home" and make it into something

Does this make sense? I hope I am not over complicating things!!!

Thanks for your help...


Current Thread