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

Re: Universally quantified test of child attribute pr

Subject: Re: Universally quantified test of child attribute presence/absence
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 20 Mar 2007 13:17:09 GMT
Re:  Universally quantified test of child attribute  pr
> Thank you very much for this hint - I actually need a test that returns 
> true if all children carry the attribute AND if there are element 
> children at all - maybe David's suggestion might help? (See below.)

there are always many ways of phrasing these things. It's best just to
say them in english (or German or any other language of choice) in a way
that makes most sense to you, and then write the xpath the same
way. It's possible that some xpath variants are more efficient than
others, but it's also possible that the difference isn't measurable, or
that the compiler re-writes the expressions to the same internal form
whatever you do, so I wouldn't worry too much about which form you use.

for example to write the xpath to match the english above you could
write

(every $c in * satisfies $c[@attribute]) and *

although a more compact way to say that in english is to say no child
exists which does not have the attribute, or in xpath

not(*[not(@attribute)])



David

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.