W3C home > Mailing lists > Public > public-xml-core-wg@w3.org > February 2007

C14N and namespace undeclaring

From: Richard Tobin <richard@inf.ed.ac.uk>
Date: Wed, 28 Feb 2007 17:04:40 +0000 (GMT)
To: public-xml-core-wg@w3.org
Message-Id: <20070228170440.EF2EC1B8CDF@macpro.inf.ed.ac.uk>

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:37 UTC