[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
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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|