xsl-list
[Top] [All Lists]

Re: Differing behavior of Xalan and Saxon with namespaces. Who's right?

2003-03-13 13:09:43


Both Xalan and Saxon are correct.  True, the Xalan output declares an
extra namespace, but the FitnessCenter element does not belong to that
namespace. So the presence of the declaration has no effect on the
interpretation of the document.


Not strictly true. Depending on how the FitnessCenter element was created (literal result element vs xsl:element vs xsl:copy) the XSLT processor is obliged to copy over different sets of namespace bindings; there is some vagueness in the spec when it comes to xsl:element, but it is clear for literal result elements and xsl:copy. In the former case, the namespace bindings from the stylesheet should be output, and in the latter the bindings from the input.

Unfortunately, without seeing the rest of the stylesheet in question we can't say if either processor is wrong. I'm going to guess that they're both right and that the author is using an xsl:element or xsl:copy; if so, I'd suggest to Roger that he create the FitnessCenter element with an LRE in which case I'm sure both saxon and xalan will output the correct bindings.


Niko Matsakis

--
DataPower technology
http://www.datapower.com




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