[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: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 12 May 2006 13:18:22 +0100
Re:  XPath context evaluation
> I apologize for hijacking the XSL list for XPath questions,

xpath is on-topic here.

> I have written some XSL-like application 

>...

> however I am not able to
> use the current context (one of the <id> elements in the <idList>) to
> evaluate an XPath expression as "//info[id = .]" 

In pure Xpath 1 you can't do this. XSLT has three solutions though so
you just need to implement one of those in your language

1) an additional xpath function, current()

  "//info[id = current()]" 

  see http://www.w3.org/TR/xslt#function-current

2) The ability to bind XPath variables in the host language

<xsl:variable name="here" select="."/>
   .... select="//info[id = $here]"

3) Implement (at least parts of) XPath2 to allow variable binding within
   XPath.

   select="for $here in . return //info[id = $here]"

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

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.