|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to: Reference to the current Nodeset while process
Hello List, I'm having the following XML structure: <XML> <Value id="123"> <aNode>bla</aNode> </Value> <Value id="123"> <aNode>bla bla</aNode> </Value> <Value id="321"> <aNode>blub</aNode> </Value> </XLM> How you can see I ve got a pretty flat hierarchy. In this case I ve got nothing else than 3 Values, each having a child node "aNode". Two of the "Value" items having a "id" with a value of "123", one having "321". This is just a simplification of the mush more complex XML strucure I really have, so the following question might make no real sence with the XML above. But it can show what my question is all about, I hope :) While processing a Nodeset "Vakue" having a attribut "id" with a value of "123", I want to get all other "Value" items, having the same id. I want to get them without using a referenc variable. I tried: <xsl:for-each select="//Value[@id = Value/@id]"> <!-- Do something --> </xsl:for-each> But this returned all Values having a attribut "id". If I declare a variable with the value of "id" <xsl:variable name="v_id"> <xsl:value-of select="@id"/> </xsl:variable> and process though the other nodes by using the variable it works: <xsl:for-each select="//Value[@id = $v_id]"> <!-- Do something --> </xsl:for-each> In this case I get all "Value" nodes having a "id" of "123". But how can I do this without using a variable? I m builing a processing variable this way, and do'nt want to define other global variables just for building another one. Thanks a lot! Jan
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








