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

XPath - How to select preceding nodes that are descendants o

Subject: XPath - How to select preceding nodes that are descendants of specific ancestor?
From: Mike Trotman <mike.trotman@xxxxxxxxxxxxx>
Date: Sat, 26 Jun 2004 12:19:16 +0100
xpath descendants
Hi.

I've got a problem that I can only seem to solve using node-set - and I
can't use node-set in my current XSLT processor.

I have an XML document with multiple subtrees starting at element
'SUBTREE' containing 'LEAF' leaf element descendants at various
hierarchical depths.
I need to know - for each 'LEAF' element - how many preceding 'LEAF'
elements there are within the closest ancestor 'SUBTREE'.

The document has many SUBTREES - so if I just use the 'preceding::' axis
and do a subtraction the processing time is horrendously long.

I've tried applying various predicates to the 'preceding::' axis
(e.g. preceding::LEAF[generated-id(ancestor::SUBTREE[1])=generate-id(current()/ancestor::SUBTREE[1])]
)
but these still seem to be pretty slow.



This feels like it should have an elegant and efficient solution - but I can't find one.


Any help greatly appreciated.

Thanks.





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.