[Bug 6152] Superfluous Namespace Declarations


Michael Kay <mike@saxonica.com> changed:

           What    |Removed                     |Added
                 CC|                            |mike@saxonica.com

--- Comment #1 from Michael Kay <mike@saxonica.com>  2008-10-10 09:46:59 ---
>However, we can't find any text in the serialization specification which would lead [us] to believe we are allowed to strip such superfluous namespace declarations.

The serializer can do anything it likes provided that it doesn't do anything
that the spec says it MUST NOT do. The spec doesn't say that it has to output
redundant namespace declarations, therefore it doesn't have to do so. In
particular, outputting redundant namespace declarations is not necessary to
meet the primary requirement of the XML output method, which is:

"The result of serialization MUST be such that the reconstructed tree is the
same as the result tree except for the following permitted differences:..."

because redundant namespace declarations will not have any effect on the
reconstructed tree.

You seem to be confusing namespace bindings (=namespace nodes) with namespace
declarations. There's nothing in the serialization spec that says each
namespace binding in the result tree should result in a namespace declaration
in the serialized output. It's not a question of "removing redundant namespace
declarations", it's a question of only generating the necessary and sufficient
set of namespace declarations needed to represent the namespace bindings.

It's also worth noting that a serializer that did generate redundant namespace
declarations would be entirely conformant, in the same way that it would be
conformant if it generates 1000 newline characters before every ">" that closes
a start tag. It just wouldn't be the world's favourite serializer.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 10 October 2008 09:47:09 UTC