[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XPath context evaluation

Subject: RE: XPath context evaluation
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 12 May 2006 21:55:13 +0100
RE:  XPath context evaluation
> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.