[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Namespaces and XML validation

  • From: Tim Bray <tbray@t...>
  • To: John Cowan <cowan@l...>, XML Dev <xml-dev@i...>
  • Date: Fri, 07 Aug 1998 09:35:45 -0700

red dev l
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@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.