OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   generating ids across multiple source documents in xslt

[ Lists Home | Date Index | Thread Index ]

I am looking for some help on the correct interpretation of the
generate-id() function with multiple source documents.

I am writing an xslt style sheet that combines multiple input documents into
one output document.  The original source document has references to other
documents which in turn may have more references to more documents.
Basically, it is a chain of href attributes.  As part of the process I use
the generate-id() function on the root of each input document and keep it on
a stack so I can keep track of which documents have been processed.  So in
the code I have something like:

<value-of select="generate-id(document($nextDocument))"/>

I've run this style sheet with saxon and msxml4 and have had no problems.
However, when I run this using dot net (xsltransform.transform), I've
discovered that this statement generates the same id for the root nodes of
all input documents. So if I have:

<value-of select="generate-id(document('x.xml'))"/>
<value-of select="generate-id(document('y.xml'))"/>

Both of these statements generate the same id using dot net, but different
ids using saxon and msxml4.

The xslt spec says that the generate-id() fucntion should generate a unique
id for every node.  To me, since the root node of one document is a
different node than the root of another document, I should get different
ids.  It should not matter that the nodes are in difference source
documents.  Is this a correct interpretation of the spec?  I appreciate any

Phillip Engel

The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized. 

If you are not the intended recipient, any disclosure, copying, distribution
or any action taken or omitted to be taken in reliance on it, is prohibited
and may be unlawful. When addressed to our clients any opinions or advice
contained in this email are subject to the terms and conditions expressed in
the governing KPMG client engagement letter.         


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS