Namespaces: Biting The Bullet

james anderson James.Anderson at
Fri Jun 5 15:54:12 BST 1998

why make this more complicated than it need be?

John Cowan wrote:
> Now, the real issue: why is a namespace element required, separate
> and distinct from the namespace PI?  Fundamentally, because XSchemas
> (unlike DTDs) are not structurally part of the document they
> describe.  Therefore, they may well have their own separate and
> distinct namespace PIs.
i read the namespace draft to be, in this regard, more liberal then the xml
spec itself, in that it does not proscribe the appearance of namespace pi's at
locations other than indicated in the modified prolog production.

which means any given entity (either the external entity which comprises the
dtd or an internal entity denoting an element) could well contain a namespace pi.
as a side effect of which a binding of prefix to namespace could be
established for the dynamic scope of the entity.

if you make this one mechanism work correctly, why would you need a second one?

> In principle, the same effect could be achieved by putting actual
> namespace PIs into the XSchema, since a namespace PI, like any
> other PI, is passed along to the application (in this case, an
> XSchema validator application). 

as long as your parser "passes" the pi in the correct dynamic scope (which
some do not (yet) do) this suffices to support dynamically scoped namespaces.

> However, this is contrary to
> the spirit of XSchema, which is to express everything using
> element/attribute syntax. 

then you should eliminate pi's in all cases.

> Furthermore, the use of actual
> namespace PIs would license an XML parser to pass through elements
> and attributes tagged with those prefixes, whereas the prefixes
> should appear in the XSchema only within attribute values, where
> they are hidden from the XML parser.
> XSchemas may well need other namespace PIs of their own.  For
> example, if a DOC element contains other elements to indicate
> formatting, these presumably come from some namespace other than
> the XSchema namespace.  If so, a PI will be in order to declare
> that namespace and some prefix for it.  If the XSchema is
> describing that very namespace ... well, that leads to a mixed-level
> cross-reference.  Keeping the PI distinct from the element solves
> the problem.

an example would help here. i don't (yet) see a problem.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list