[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: Wed, 28 Feb 2007 00:04:04 +0100
Re:  How to use generate-id() inside an xsl:function  w
Michael Kay wrote:
But please get out of the habit of using xsl:value-of
when you mean xsl:sequence, and please get into the habit of declaring the
types of your functions! This should be

For your comfort: that is precisely the way it is in my XSLT, I just left it out for brevity ;)


And indeed, I still often use xsl:value-of, I partially blame XSLT 1 for that: I use both on a daily basis and get confused....

The cheapest solution is probably a text or comment node rather than an
element, something like:

<xsl:function name="my:getNode"><xsl:comment/></xsl:function>

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

Remember that an LRE like <node/> might be creating a lot of namespaces...

That is a great tip. Thanks!


-- Abel

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-2011 All Rights Reserved.