Re: Last call announcement for Namespaces 1.1

> This is was I expect, but to be clear, if possible, is there also an 
> expectation that it would *not* be used with XML 1.0?

Namespaces 1.1 does not apply to XML 1.0 documents.  A processor that
allowed, say, xmlns:foo="" in an XML 1.0 document would not be conforming
to either Namespaces 1.0 or Namespaces 1.1.

> So what exactly *is* the difference.

Namespaces 1.0 allowed the default namespace to be undeclared by
using xmlns="".  Namespaces 1.1 in addition allows prefixes to be
undeclared, e.g. xmlns:foo="".

> And if there is a difference between NS 
> 1.0 and 1.1, did XPath 1.0 anticipate the change and already correct for it 
> in its data model?

The XPath 1.0 data model says:

   Each element has an associated set of namespace nodes, one for each
   distinct namespace prefix that is in scope for the element
   (including the xml prefix, which is implicitly declared by the XML
   Namespaces Recommendation [XML Names]) and one for the default
   namespace if one is in scope for the element.

This remains true.

It goes on to say:

   [...] This means that an element will have a namespace node:

    * for every attribute on the element whose name starts with xmlns:;

this needs to be changed to "every attribute on the element whose
name starts with xmlns: and has a value which is non-empty";

    * for every attribute on an ancestor element whose name starts xmlns:
      unless the element itself or a nearer ancestor redeclares the prefix;

this should be changed to say "... redeclares or undeclares";

    * for an xmlns attribute, if the element or some ancestor has an
      xmlns attribute, and the value of the xmlns attribute for the
      nearest such element is non-empty;

this remains true.

Essentially the XPath data model is unchanged; it's just possible to
construct some values of the data model that couldn't previously be
obtained by reading in an XML document, viz. ones in which a child
element does not have a namespace node for a prefix that its parent
has one for.

XSLT 1.0 already allows you to construct such data models, but they
cannot be accurately serialized with Namespaces 1.0.  Namespaces 1.1
allows them to be serialized accurately.  XSLT 1.0 says (under "XML
Output Method"):

  The output should be such that if a new tree was constructed by
  parsing the wrapper as an XML document [...] the new tree would be
  the same as the result tree, with the following possible exceptions:

  [...]

  The new tree may contain namespace nodes that were not present in
  the result tree.

That exception is not necessary when serializing as XML 1.1 + Namespaces 1.1.

-- Richard

Received on Tuesday, 10 September 2002 19:14:23 UTC