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

Re: How to use generate-id() inside an xsl:function w

Subject: Re: How to use generate-id() inside an xsl:function without a node available?
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 27 Feb 2007 22:58:14 +0100
Re:  How to use generate-id() inside an xsl:function  w
Dimitre Novatchev wrote:
I think in this case generate-id() will be applied on the same node
again and again and will return the same string -- this is why I want
always to have a new copy of it -- or am I wrong?

I am honoured with so much attention for such a seemingly simple question ;)


Inside a function, apparently, the node is recreated on each function call. Whether it is this:

<xsl:function name="my:getNode"><node /></xsl:function>
<xsl:function name="my:getId"><xsl:value-of select="generate-id(my:getNode())" /></xsl:function>


or whether you use variables to achieve the same result. Apparently, the node need not be part of the result tree to achieve this effect (maybe it is, I don't know, but it is never output at least).

The variable-inside-one-function (like David's solution) is the one I currently employ, but any variant is likely to succeed if I understand Michael Kay correctly.

-- Abel Braaksma

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.