Re: DM expressing until-like queries in XPath 2.0

something like

.//*
  [@l='no' and not(ancestor::*[
      count(.|current()/descendant::*)=
          count(current()/descendant::*)]/@l='no')]

would restrict the ancestors to be descendants of the current node but
that requires the xslt current() function (and if you're using xslt you
could write the whole thing much more simply using xslt conditionals.


in pure xpath2 I suppose it's something like

for $here in .
  return
  $here//*[@l='no' and (every  $a in ancestor::*[@l='yes'] satisfies 
      (some $d in $here/descendant-or-self::*  satisfies $d is $a ))]


for each descendent with @l=no check that all its ancestors with l=yes
are descendents of the current node.


-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. 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
________________________________________________________________________

Received on Thursday, 27 November 2003 09:01:43 UTC