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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Namespaces and XML validation

[ Lists Home | Date Index | Thread Index ]
  • From: Tim Bray <tbray@textuality.com>
  • To: John Cowan <cowan@locke.ccil.org>, XML Dev <xml-dev@ic.ac.uk>
  • Date: Fri, 07 Aug 1998 09:35:45 -0700

At 11:37 AM 8/7/98 -0400, John Cowan wrote:
> The developers of namespaces don't seem to give
>a red rubber rat's **** about DTD-based validation.

Well, never having actually owned any red rubber rat genitalia
(unless of course you meant ***** to stand for "eyelashes" - I 
have lots of red rubber rat eyelashes) I can't comment on that
particular transaction.

Having said that, there is no doubt that when we went from document-global 
PI-declared namespaces do element-scoped attribute-declared namespaces, 
traditional DTD validation got somewhat messier.  I personally am not very 
happy with that trade-off, but people I respect were on the other side of 
that vote and there's no doubt that scoping and defaulting make namespaces 
quite a lot more *usable*.

But on further consideration... doing traditional XML validation of
namespaced documents involves an (easy) syntactic problem and a (hard)
compounding problem.  Let's assume we have a way to make all the
names in the DTDs match the ones they should in the document (the
syntax problem, see below).  That leaves the hard problem of constructing
the compound master DTD that validates the way all the bits fit
together.  I'm not optimistic (ever) about solving that one, without
human intervention, in the context of 8879-style markup declarations.
But people are clever, so let's see.

As for the syntax problem.  Let's assume we've got a compound DTD, and
know, for each name in there, what namespace it comes from.  Let's
further assume that we've got an instance that contains prefixes,
including:
 - some defaulted elements that are namespaced even without prefixes
 - some cases where two different prefixes are used in different
   scopes to refer to the same namespace
 - some cases where the same prefix is used in two different scopes
   to refer to different namespaces

So you take one pass through the instance, observing which namespace
URIs are in play.  You make a unique prefix for each.  You take another
pass through the instance, declaring all the prefixes on the root
element, and eliminating all defaults, so that everything is prefixed,
and that the same prefix is used for each namespace in all cases.  Then
you go back and munge the DTD, inserting the same namespace
prefixes on all names as appropriate.  Then you validate.
Hey-presto!

I think all the above, while icky, is perfectly tractable.   But it
presupposes you have some good technology for (or even industry 
experience in) constructing the compound DTD in the first place, which 
we don't.

To summarize: the new namespace proposal makes the (easy) syntax
munging problem somewhat harder (but not, I argue, qualitatively).
It doesn't affect the (hard) compounding problem, which is the one
we really ought to be worrying about more than we are. -Tim

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

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

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