xsl-list
[Top] [All Lists]

RE: [xsl] XPath context evaluation

2006-05-12 13:55:51
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/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--