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

Re: question about generate-id()

Subject: Re: question about generate-id()
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 06 Aug 2010 12:29:42 -0400
Re:  question about generate-id()
At 2010-08-06 16:53 +0100, Dave Pawson wrote:
On Fri, 06 Aug 2010 16:37:09 +0100
David Carlisle <davidc@xxxxxxxxx> wrote:

> On 06/08/2010 12:31, Dave Pawson wrote:
>
> >
> > If implementations did what the casual reader might assume
> > I wouldn't have to Andrew?
> >
> > The spec, read today, with xml:id existent, is misleading.
> >
> xml:id isn't related to generate-id is it?

It is the 'todays' version of id, as used in XML.

Fine.


Hence in my view generate-id() function should generate an id value
as defined in XML rec.

It does.


so yes, in my view, it is related David.

I don't follow your argument, Dave. An input document's identifiers have *no* relationship to generate-id().


Consider this: if your reasoning that generate-id() must produce a value set exclusive of the xml:id values to ensure that id values in the output are unique, this falls apart when you consider that the aggregation of two documents where each are independently (and validly) using the same value for xml:id=. The processor cannot automatically disambiguate them in the aggregation because that would break references.

However, if you follow my rule of thumb that *every* xml:id= or id= or ID-typed attribute named prod= (for example) is translated to output using the generate-id() for that node ... and every reference to those identifiers is replaced with the generated identifier for the referenced node, then the references will be both preserved and unambiguous in the result.

As to the earlier comment contributed regarding pointers from outside of the document to inside the document, in an aggregation where ids are not unique across the input set there would still be a problem of ambiguity even if the ids are not translated.

Therefore, generate-id() is necessarily independent of any knowledge of any content. It is a model implementation concept and not a data concept. In the classroom I teach this concept in the same discussion as the XPath data model, and the function is later on described as the exposition of this aspect of the implemented data model. This helps students understand that generate-id() is exposing a single value that has been generated for a given node, not actively generating new identifiers each time it is called for a given node in a single transformation.

I hope this is considered helpful.

. . . . . . . . . . Ken

--
XSLT/XQuery training:   after http://XMLPrague.cz 2011-03-28/04-01
Vote for your XML training:   http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.