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

Re: Creating unique node attributes in output

Subject: Re: Creating unique node attributes in output
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Sat, 03 May 2003 18:23:08 +0200
unique output
Gregory Propf wrote:
I am trying to write a stylesheet that processes an xml file and assigns a globally unique id tag to the output of each node I process. These tags are not present in the original xml. I thought of just creating a variable and incrementing it and using that but it seems that varaibles are not really so variable in xsl. How is this done?

You can't increment variables in XSLT like you do in procedural languages like JavaScript. You usually don't need to do this.

For your specific problem, look up the generate-id() function:
 http://www.w3.org/TR/xslt#misc-func

If this doesn't quite fit (unlikely, but possible in some situations),
use a combination of hard-coded prefixes, generate-id(),
parameters passed through recursively processed templates and
perhaps position() and xsl:number

J.Pietschmann


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.