Re: Generating XSLT
<xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
It has been tried and failed.
If you don't preserve the prefix then when you use the target prefix in an attribute value (and the processor doesn't know which attribute values are qnames that require namespace prefix transliteration), then you end up with a disconnect. Your emitted stylesheet includes namespace prefix uses without a resolved namespace URI.
"In the early days" (tomorrow is the 5th anniversary of XSLT/XPath 1.0!) there were processors that emitted arbitrary namespace prefixes in the result tree and my stylesheets for writing stylesheets didn't work.
Yes, I know the spec doesn't oblige the processor to use the authored prefix, but I cannot see any other way. Even if you hardwire the processor to recognize output XSLT and transliterate only the namespace prefixes found in there in context (awkward at best), that disenfranchises other existing and future vocabularies that will need to have the output namespace bound for attribute value usage.
If the processor uses an arbitrary namespace prefix, it will never know which values in the result tree are QNames.
But if the processor uses the authored namespace prefix, then the author of the stylesheet has an assurance that the use of QNames arbitrarily in the result will have bound prefixes.
I hope this helps.
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