Re: [xsl] question about generate-id()

Subject: Re: [xsl] question about generate-id()
From: Mark Howe <mark@xxxxxxxxxxxxxx>
Date: Sun, 08 Aug 2010 14:54:43 +0200
I was somewhat dismayed to discover a while back that generate-id()
didn't generate unique ids across multiple runs or with respect to
source documents. I think this makes generate-id() a lot less useful
than would otherwise be the case. But I can also see that checking for
uniqueness in arbitrary length and possibly multiple source documents is
not cheap.

For the Xcruciate project we rolled our own extension functions. The
more sensible of the two generates a UUID [1] that is supposed to be
unique anywhere in the universe, so probably with respect to the source
document. If a client ever complains about duplicates I plan to ask them
to replicate the problem :-)

Is there a good reason why a conforming implementation of generate-id()
couldn't return a UUID or similar? Presumably the processor could
generate an id however it does it now, generate a UUID with that id as a
key, and return the UUID wherever it would normally return the id. It
doesn't sound to me like it would be hard to code or expensive to run.

Would that be one way to keep everyone happy?

[1] http://www.ossp.org/pkg/lib/uuid/

Current Thread