|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: value of parent tag
Daniel Bauke wrote: > <aaa key="abc"> > <cc/> > <cc/> > </aaa> > <aaa key="cde"> > <cc/> > <cc/> > </aaa> > > and i need to know 'key' value of a parent tag in each > particular <cc/>. on the example in 1st and 2nd <cc/> it's > "abc", in 3rd and 4th - "cde". Daniel, the xml text above is not well formed, so I used the following: <top> <aaa key="abc"> <cc/> <cc/> </aaa> <aaa key="cde"> <cc/> <cc/> </aaa> </top> The results you want can be obtained using the following XPath expression: (//cc)[position()=$k]/../@key where $k will have some value ranging from 1 to count(//cc) Cheers, Dimitre Novatchev. __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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








