I’m building an XML transformer and I need to pass parameters into the stylesheet while the transformation is happening.
The problem is that one XML file can have more than one elements that needs a different UUID for example.
transformer.setParameter("uuid", "'3234343-3434343-343434343-3434343434'");
It there are way of passing a dynamic variable so each element in the XML will end up with a different UUID?
This is not the only parameter I’m passing. I’ll have to look up data from external databases as well and feed that into the stylesheet.
Can I pass an array or a hash table if I pre-populate it or maybe ?
Or do I have to approach it with a whole different way? If so what is the best way of doing this?
Many thanks
The UID I managed to sort out with
<xsl:value-of select="generate-id(.)"/>in the xsl file.