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]
Other format: [Raw text]

RE: filtering by ancestor


> I'm writing a breadth-first parser but I want to restrict the 
> parse to /resultset/result[1] So at any given node I need the 
> subset of following::* that has /resultset/result[1] as an ancestor.
> 
Some processors have an xx:intersect() extension function:

  xx:intersect(/resultset/result[1]//*, following::*)

In XPath 2.0 you can do

  /resultset/result[1]//*[. follows current()]

which might be rather more efficient if the subtree is small compared
with the full document.

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com 


 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]