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

generating ids across multiple source documents in xslt

xslt multiple input documents
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.         


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.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.