C14N and namespace undeclaring

I don't really have a view on what C14N should do, but let me summarise
what I said about "correct serialisations".

Given:

  <a xmlns:one="http://one.example.com">
    <b xmlns:two="http://two.example.com"/>
  </a>

there is no problem serialising <b> correctly: its in-scope namespace
prefixes are one and two so we have:

  <b xmlns:two="http://two.example.com" xmlns:one="http://one.example.com"/>

If a <c> element is (somehow) added as a child of <b>, and it has the
prefix two but not the prefix one in scope, we cannot serialise <b>
correctly in XML 1.0, but we can in XML 1.1 by using an undeclaration:

  <a xmlns:one="http://one.example.com">
    <b xmlns:two="http://two.example.com">
      <c xmlns:one=""/>
    </b>
  </a>

Such a node set can be created in XSLT 1.0, or (of course) by reading
an XML 1.1 document.

If however we want an element in some namespace without having a
prefix for that namespace in scope, it can't be done in any version of
XML.  XSLT processors will just make up some prefix and bind it, with
the result that some extra prefix is in scope.  This doesn't matter
normally, but presumably C14N doesn't want randomly-chosen prefixes.

-- Richard

Received on Wednesday, 28 February 2007 17:04:52 UTC