Re: [xsl] Context node traversal inside predicates (was: Nodes and Strings)

Subject: Re: [xsl] Context node traversal inside predicates (was: Nodes and Strings)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 26 Jul 2005 14:29:00 +0100
> This problem encouraged me to finally post about some lack of  
> functionality I've always been experiencing in XPath1.0

I posted a reply yesterday that didn't seem to come back

  <xsl:template match="setA">
  <xsl:variable name="b" select="../setB/element"/>
   <setC>
   <xsl:copy-of select="element[concat('aStringBeforeValue.',.)=$b]"/>
  </setC>
  </xsl:template>

But you are correct that in general if you need to apply any string
functions then you use the existential quantification over node sets
that is built in to =.


> Will this kind of functionality be available in Xpath 2 ? 

yes or no, depending on how you define "this kind". there is no analogue
of your context() function to work bacl up xpath steps, but you can use
for instead of / then you get a variable at each step that you can use.
Also as you can use 
$setB/Element/substring-after(.,'.') = .
and get the implict quantifier back.

Also xpath2 has explict some and exists operators, when you need them.

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