RE: [xsl] Extra xmlns=""

Subject: RE: [xsl] Extra xmlns=""
From: mhkay@xxxxxxxxxxxx
Date: Tue, 17 Jul 2001 05:56:20 +0100 (BST)
> I've noticed that some XSLT engines, when converting from XML 
> to XHTML,
> will insert extra empty xmlns="" attributes into some tags, 
> even though
> the XSLT script does not tell it to.  The div and hx tags 
> generally get
> these.  Of course, the file is then not valid XHTML.

This has nothing to do with the output being XHTML, and nothing to do with the specific elements being output. An xmlns="" (I call it a namespace undeclaration) must be output for an element E if the parent node of E has a namespace node with (name = "", value = something other than ""), and if E has no namespace node with name = "". The conditions that cause this situation to arise in the result tree depend entirely on your stylesheet; and of course the XSLT processor doesn't even know that you are trying to produce XHTML.

If two processors produce output files that are materially different in their namespace declarations, then one of them is wrong.

Mike Kay
Software AG
> 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread