Subject: Re: [xsl] can a function return an element of a nodeset From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Thu, 13 Jan 2011 15:17:26 +0100 |
I'm wondering if there is a way to make a function returning an element (or a kind of "pointer" to an element) of a another document. Something like :
<xsl:function name="my:get-node" as="item()*"> <xsl:param name="id"/> <xsl:copy-of select="document('foo.xml')/bar[@id='$id']"/>
<xsl:sequence select="document('foo.xml')/bar[@id=$id]"/> returns the node(s) itself(themselves), without copying.
</xsl:function>
The xsl:copy instruction will here copy the node wilthout his contexte, but I would like to be able to perform xpath test which need the context of this node within foo.xml, such as :
<xsl:value-of select="count(my:get-node('123')/preceding-sibling::*)"/>
I guess this is not possible, can someone confirm this ?
Martin Honnen http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] can a function return an elem, Matthieu Ricaud-Duss | Thread | Re: [xsl] can a function return an , Matthieu Ricaud-Duss |
[xsl] can a function return an elem, Matthieu Ricaud-Duss | Date | Re: [xsl] can a function return an , Matthieu Ricaud-Duss |
Month |