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

can a function return an element of a nodeset

Subject: can a function return an element of a nodeset
From: Matthieu Ricaud-Dussarget <matthieu.ricaud@xxxxxxxxx>
Date: Thu, 13 Jan 2011 15:12:44 +0100
 can a function return an element of a nodeset
Hi all,

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: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 ?

Thanks,

Matthieu

--
Matthieu Ricaud
IGS-CP
Service Livre numirique

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.