Re: generating ids across multiple source documents in xslt
At 21:41 13/04/2004, Engel, Phillip wrote: >I am looking for some help on the correct interpretation of the >generate-id() function with multiple source documents. > > >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 >thoughts. IIRC the xslt list summary has been to expect repeated id values for different document roots. An easy one would be to prepend the document name (or some subset of it) to each id value to obtain a unique 'cross document' id. HTH DaveP
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format