[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: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 27 Feb 2007 21:52:10 GMT
Re:  How to use generate-id() inside an xsl:function  w
> 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?

no a literal result element like <x/> is (more or less) the same as using
<xsl:element name="x"/> it's a single node in the stylesheet but it
generates a new node each time it's executed, and generate-id() is being
applied to that result. You don't need an element at all of course, a
text node will do

<xsl:function name="pref:myId" as="xs:string">
 <xsl:variable name="myNode">x</xsl:variable>

  <xsl:sequence select="generate-id($myNode)"/>

<xsl:function



(you can't use
 <xsl:variable name="myNode"/> as that generates a zero length string
 not a node at all, for reasons of xslt1 cmpatibility)

David

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.