OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Does DTD validation work with namespaces?

[ Lists Home | Date Index | Thread Index ]
  • From: "Paul W. Abrahams" <abrahams@valinet.com>
  • To: xml-dev@xml.org
  • Date: Mon, 07 Aug 2000 15:50:04 -0400

Rick JELLIFFE wrote:

> "Winchel 'Todd' Vincent, III" wrote:
> > 3. Namespaces
> >
> > Consensus on this list is they they don't work.  Certainly, DTD validation
> > and Namespaces don't work.  Nowhere is this stated in the W3C Namespace
> > Recommendation.
> Incorrect.  DTD validation does work with namespaces. Namespaces are a
> layer interpreted after validation. That is clear from the namespaces
> spec. It is not
> the consensus on this list that namespaces don't work: I use them every
> day
> and they work fine for my use.  (The namespaces spec is underspecified
> as far
> as URIs go, and does not give us the semantic web that some people think
> it
> should, and I think some of the non-normative appendixes are botched,
> but
> none of those things mean it does not work.)

This isn't the first time this issue has come up.  What's striking is that the
proponents of the opposing views (namespaces work with DTD's; they don't) treat
the answer as obvious and hardly worth discussion.

The problem I see is very simple.  If I publish a DTD for general use with the
intent that the names within it be declared by the importer as a namespace, then
that namespace has a prefix.  Since the DTD is intended to be universally
applicable no matter what the prefix of the namespace describing it, it cannot,
itself, use prefixed names: what prefix would it use?  And if the DTD's element
names are unprefixed while their uses in the document are prefixed, then
validation fails: names don't match definitions.

There is, to be sure, a way around this.  The DTD can prefix every name with an
entity reference, and the calling document can declare that entity reference to
have as its value the correct prefix, effectively parameterizing the DTD.  But
this is a kludge - an ugly, awkward kludge that I don't think anyone is defending
as an adequate solution.

It would be possible to solve this problem by extending the syntax of EntityDecl
to allow the specification of an implicit prefix for an included DTD, but that
would require integration of the Namespace spec into the XML spec.  Personally I
believe that would be a Good Thing, but it doesn't appear to be in the cards.

Paul Abrahams


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS