Re: [xsl] Universally quantified test of child attribute presence/absence

Subject: Re: [xsl] Universally quantified test of child attribute presence/absence
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 20 Mar 2007 13:17:09 GMT
> 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