[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: value of parent tag

Subject: Re: value of parent tag
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 23 May 2001 02:28:52 -0700 (PDT)
xml 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.