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

Re: combining node restrictions in select statements

Subject: Re: combining node restrictions in select statements
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 28 Mar 2006 13:46:42 +0100
select nodes starts with
 select="/root/a[d[starts-with(e, 'A')]] and a[not(b=following::a/b)]" 

that is legal XPath but it's a boolean valued expression returning
true() or false(), also the a after the and will select child elements
of the current node, not the same element as selected by /root/a before
the and. However you wantto select nodes not return a boolean, I think
you want to do something like



 select="/root/a[d[starts-with(e, 'A')] and  not(b=following::a/b)]" 

so now the boolean valued expression
   d[starts-with(e, 'A')] and  not(b=following::a/b)
is just used as a predicate to filter /root/a

Note however that for each a you select you also select following::a so
this is rather inefficient if you have a lot of a's in the list.

google for muenchian grouping (especially on jeni tennison's site) for
techniques to make that more efficient.

Or in xslt2 you will be able to use xsl:for-each-group which is rather
easier to use.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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-2011 All Rights Reserved.