Re: ***********Transformation of an XML document conta
> I tried doing something like this a few weeks ago and it didn't work > for me. There seems to be no way to control which namespace prefix > (including the "empty" prefix) the serializer uses if there is more > than one prefix for a given namespace URI.
Can we not, however, assume that the processor has to preserve the namespace prefix regardless of what the Spec says?
The reason I ask came up when I wrote a stylesheet that writes stylesheets, and I used a processor that did not preserve the namespace prefix ... the author of the processor ended up changing it so it does preserve the prefix because this particular situation I had (and anyone else could have) requires that it be done.
Consider I have a stylesheet using "xsl:" for XSLT instructions and "xslo:" for my result tree prefix where the XSLT stylesheet generates an XSLT stylesheet using namespace-alias accordingly. Given I am using "xslo:" in the template for my result, I may have the following:
<xsl:template match="foo"> <xslo:value-of select="system-property('xslo:version')"/> </xsl:template>
If the processor does not preserve the prefix that I use, then the resulting XSLT stylesheet will not have a valid string being passed to the system-property() function, as there would be no namespace mapped to the prefix I use in my function argument. And no amount of heuristics would help a processor unambiguously find my use of namespace prefixes in other contexts than a namespace prefix of elements or attributes.
I hope this helps.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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