Subject: Re: [xsl] XPath context evaluation From: Victor Toni <xsl-list@xxxxxxxxx> Date: Fri, 12 May 2006 22:12:07 +0200 |
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]"
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XPath context evaluation, David Carlisle | Thread | RE: [xsl] XPath context evaluation, Michael Kay |
RE: [xsl] XPath context evaluation, Michael Kay | Date | Re: [xsl] XPath context evaluation, Victor Toni |
Month |