|
next
|
 Subject: How to omit namespace attribute Author: Minollo I. Date: 09 Jun 2005 10:33 PM
|
You are using xsl:copy to copy some nodes to your result (like, for example, the root <vxml/>), and you are creating some other elements "by hand", with xsl:element instructions. xsl:copy (http://www.w3.org/TR/xslt#copying), as also xsl:copy-of, need to copy namespace declarations too; and <vxml/> belongs to the xmlns="http://www.w3.org/2001/vxml" in the source. That's why it's created that way in the result. When you create the other elements "by hand", those are defined in the default namespace, not in "http://www.w3.org/2001/vxml"; and Saxon (I'm assuming you are using Saxon, as this is an XSLT 2 stylesheet) uses the XML 1.1 semantics of xmlns="", which is to undefine the current xmlns definition.
So, I would say that the occurences of xmlns you are getting are expected; to avoid them, you'll need to avoid using xsl:copy and xsl:copy-of, as the whole source document lives in a redefined default namespace.
Hope this helps,
Minollo
|
|
|