Namespace undeclarations in 1.1

A question about namespace undeclarations in 1.1. [NS1.1]

Does the construct xmlns:p="" make p be "out of scope", so any reference to
p is an error, or does it make p refer to the non-namespace, in the same way
as xmlns="" makes the default prefix refer to the non-namespace?

[Definition: the non-namespace is the set of all names that are not in a
namespace. We desperately need a name for this concept.]

I had assumed the former, but re-reading the spec it's not at all clear.

It says:

"The scope of a namespace declaration declaring a prefix extends from the
beginning of the start-tag in which it appears to the end of the
corresponding end-tag, excluding the scope of any inner declarations with
the same NSAttName part".

Now it seems that xmlns:p="" is classified as a namespace declaration and
therefore has a scope. We then read:

"This [xmlns:p] has the effect, within the scope of the declaration, of
removing any association of the prefix with a namespace name".

But what replaces this previous association? Does it associate p with
nothing (making any reference to p an error), or does it associate it with
the non-namespace? It would be nice to be told. Both interpretations appear
to be perfectly reasonable, and both are consistent with the spec as
written.

Further (and this really is strange), reading section 7 (Conformance), it
says that a document to be well-formed must match the "Namespace
Constraints" (in quotes). But the "namespace constraints" are nowhere
defined, so this gives no further clues.

It would be very useful to be able to refer to the non-namespace using an
explicit prefix, especially in a context like XSLT, so this is not just an
academic question.

Michael Kay
http://www.saxonica.com/

[NS1.1] http://www.w3.org/TR/xml-names11/

Received on Thursday, 7 October 2004 12:39:51 UTC