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

Re: the nearest ancestor with the attribute

Subject: Re: the nearest ancestor with the attribute
From: "Jonathan Borden" <jborden@xxxxxxxxxxxx>
Date: Wed, 17 Jan 2001 07:38:16 -0500
Re:  the nearest ancestor with the attribute
Jeni Tennison wrote:
> Hi Wendell,
>
> >> > ancestor::*/@attr
> [snip]
> >>
> >>I don't think so. The first in this case is the first in document order,
> >>which isn't the nearest in the ancestor axis.
> >
> > Hm. About this, see XPath 2.4. ancestor is a reverse axis. I don't see
> > anything here that changes the order to document order.
>
> You're absolutely right that the ancestor axis is a reverse axis.  If
> you were using:
>
>   ancestor::*[1]/@attr
>
> you'd be fine (aside from the fact that you'd be stuffed if the node's
> parent didn't have a 'attr' attribute). However, the last axis used in
> the XPath is the 'attribute' axis, which takes you back to document
> order again. To get the last one, use:
>
>   ancestor::*/@attr[last()]
>
> At least I *think* that's right ;)

Actually isn't it

    ancestor::*[@attr][1]/@attr

?

-Jonathan



 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.