Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force xslt to generate the "xml" domain name

I need xslt version 2 to generate the domain name for the "xml" attribute prefix (xml:lang="en-us") at either at the record or element level:

xmlns:xml="http://www.w3.org/XML/1998/namespace"

I tried using both xsl:namespace and using xsl:attribute ... namespace=

Neither worked for me - any suggestions would be terrific Thanks David

like image 332
David Loy Avatar asked Jun 03 '26 12:06

David Loy


1 Answers

According to http://www.w3.org/TR/REC-xml-names/#ns-decl "The prefix xml is by definition bound to the namespace name http://www.w3.org/XML/1998/namespace. It MAY, but need not, be declared, and MUST NOT be bound to any other namespace name." so while you can certainly use that namespace on a literal result element or output it with xsl:namespace I think there is no guarantee that the serializer outputs it as omitting it does not change the semantics of the XML.

like image 108
Martin Honnen Avatar answered Jun 06 '26 06:06

Martin Honnen