I want to transform an XML document into HTML. Some XML elements have links to others documents like:
In the H
To start with, I assume that due to some unknown reason you cannot use the absolute URL in the link as the required UID -- this is the simplest and most natural solution.
In case my assumption is correct, then:
This is an easy task for XSLT.
Because the OP wants the generated ids to be the same when the transformation is performed several times, it isn't appropriate to use the generate-id() function.
Here is one simple way of producing stable ids:
when this transformation is applied on the following XML document (regardless how many times):
the wanted, same, correct result is produced every time:
Do note: The use of to produce the id.
If the same link can occur several times in the document and we need all occurences to use the same id, here is the solution for this problem:
when this transformation is applied on the following XML document:
the wanted, correct result is produced: