This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: the nearest ancestor with the attribute



> > 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 ;)


I wish someone would do a clear exemplified piece on this for the faq.


 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]