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

Re: Re: Creating unique node attributes in output

Subject: Re: Re: Creating unique node attributes in output
From: Gregory Propf <gpropf@xxxxxxxxxx>
Date: Sat, 03 May 2003 21:39:51 -0400
unique node identifier xml
Dimitre Novatchev wrote:
"Gregory Propf" <gpropf@xxxxxxxxxx> wrote in message
news:3EB3E7C6.6010004@xxxxxxxxxxxxx

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?


In the general case even using generate-id() will not provide uniqueness -- the same node may be produced many times, or sometimes different nodes (in
temporary trees) are assigned the same (re-used when a temporary tree has
been disposed of) id.


This is a typical use-case for a Monad.

I would be at XML Europe next week and if somebody would be interested I can
demonstrate the current Monadic Computation implementation, which is part of
FXSL.



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL




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




Ok from the w3c we have


"...Thus, the string is syntactically an XML name. An implementation is free to generate an identifier in any convenient way provided that it always generates the same identifier for the same node and that different identifiers are always generated from different nodes..."

It sure sounds like the node id will always be unique. Or am I not interpreting this right? I guess what concerns me is that I get unique ids within a given tree like this


<a> <b/> <b> <c/> <c/> </b> <b> <c/> </b> </a>

All I really need is that within that kind of structure I get unique ids. That said, I tried it and got it to work. I am happy with the results and it certainly seems like it is producing unique ids. I'm just curious about the details. Thank you all for your help.



--
"Firing people can give you a pretty good buzz, but it's a poor, poor substitute for killing. I realize that now" - Dale Gribble



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.