Subject: Re: [xsl] question about generate-id() From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sun, 08 Aug 2010 08:06:40 -0400 |
On Sun, 08 Aug 2010 09:19:55 +0100 Michael Kay <mike@xxxxxxxxxxxx> wrote:
> > > > > a given node? Again, a node from which nodeset? > > All possible input nodes from the source document, doc() functions? > > > > Any node that you pass to the function as an argument. The result is > unique in the sense that if you call the function on two different > nodes, you get two different identifiers.
So not 'unique' as xml:id defines unique?
Or as the spec puts it: "it > always generates the same identifier for the same node and ... > different identifiers are always generated from different nodes."
Again only in the context of the call to the function. I.e. there is no explicit scope.
> > My inferences: I assumed (clearly wrongly by this thread) that it > > generated an ID value (call it xml:id for now) that was unique as > > per the definition in XML, i.e. unique amongst the nodes of the > > input document. > > > > The spec explicitly says "There is no guarantee that a generated > unique identifier will be distinct from any unique IDs specified in > the source document.".
So 'generate-a-random-string' might be more accurate than generate-id?
-- 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] question about generate-i, Dave Pawson | Thread | Re: [xsl] question about generate-i, Dave Pawson |
Re: [xsl] question about generate-i, Dave Pawson | Date | Re: [xsl] question about generate-i, Mark Howe |
Month |