RE: [xsl] XPath context evaluation

Subject: RE: [xsl] XPath context evaluation
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 12 May 2006 21:55:13 +0100
> In the meantime I found a nearly trivial solution which lets 
> my keep my
> environment:
> 
> "subsequence(//info,index-of(//info/id, .), 1)"
> 
> These functions were easy to implement and solved the issue I 
> had. Since performance doesn't count for this use case I am 
> glad it works :-)

This isn't 100% equivalent to //info[id = current()], unless you make
assumptions about the data, for example that there is no more than one
match.

But if you're using XPath 2.0, then what's wrong with

for $x in . return //info[id = $x]

(which is equivalent: in fact it's essentially what Saxon compiles the
original code into)

Michael Kay
http://www.saxonica.com/

Current Thread