Aliasing prefixes (not namespaces) in XSLT
|September 13, 2014||Posted by forumadmin under TechQns||
I want to change the prefix in the output from the prefix in the styleheet itself.
<styleheet version="1.0" xmlns:a="nsA"> <template match="/"> <a:out/> </template> </styleheet>
What I get:
<a:out xmlns:a="nsA" />
What I want:
<b:out xmlns:b="nsA" />
Note that I want to change only the prefix, not the namespace. The element namespace-alias will translate only the namespace, leaving the prefix intact.
Bonus points if it is possible to remove the prefix completely:
<out xmlns="nsA" />
Note that the XSLT elements are not prefixed and the output elements are prefixed. It has to remain like that. I know that the problem could be solved with prefixing XSLT and un-prefixing output elements, but it’s not an option. The to-be-output elements must have the prefix as provided in the styleheet, only in the output should they be changed.
|Asked By – haael||Read Answers|