Namespaces hate validation!
murray at muzmo.com
Wed Jan 6 03:13:33 GMT 1999
At 08:46 PM 1/5/99 -0500, Tim Bray wrote:
>At 04:55 PM 1/5/99 -0500, Simon St.Laurent wrote:
>>Namespace prefixes hate validation.
>Those who've heard my argument on this subject can tune out now.
Sadly, I don't feel that I can tune out on this one. In fact,
>Here goes, again. Namespaces create two problems; an easy syntactic
>problem, and a hard design problem. The syntactic problem is that
>of validation, but there is a clean algorithmic solution:
>1. You have a DTD that contains elements from different namespaces
> and you know what the URIs are for those namespaces.
Everything that follows this point is predicated on the
assumption that one can have such a DTD, but later Tim
makes it clear that it is not currently feasible to design
such a DTD. As Tim says, "we're nowhere near knowing the answer."
>2. You have a document that has tags from different namespaces, and
> you know what those namespaces are.
>3. You want to validate the document against the DTD.
>4. You make a list of all the namespace URIs that are in play via the
> DTD. For each you generate a unique prefix.
>5. You preprocess the DTD, rewriting all the element & attribute
> declarations with the appropriate prefixes
Using special care to take into account the non-XML notion
of "global attributes".
>6. You preprocess the instance, making all namespace prefixes
> explicit (no defaulting), declaring all the namespaces on the root
> element, and using the same set of prefixes you used in the DTD
Of course, this will not work for instances that redeclare
a namespace prefix with a different URI for the purposes
of local scoping of namespaces. In that case, you have to
declare namespaces on elements as you go. And, since you
would have to inspect the entire document to determine
whether local scoping of namespaces has been applied,
you simply cannot count on Tim's algorithm for the general
>7. You validate
>OK, this is a bit tedious but contains NO ROCKET SCIENCE. The
>syntactic problems of validating in the presence of namespaces are
>just not that hard.
Well, tedious enough to make it unlikely that anyone will use
validation on documents that utilize namespaces. It is hard.
It is too hard. And for that reason, among others, Veo has
vociferously opposed "Namespaces in XML".
>Now, on to the difficult problem: how do you go about making that
>DTD I mentioned in step 1, that has the combined elements? Right now
>we have little in the way of technology or automated procedures or even
>industry experience to aid us in designing that compound DTD in a good,
>clean, and efficient way. That's a hard problem and one that some
>of the schema proposals are feeling toward a solution for. But we're
>nowhere near knowing the answer.
As a co-author of one of the schema submissions, I have to say
that I do not see how to integrate "Namespaces in XML" -- as
it is currently proposed -- with an XML Schema language. Perhaps
someone will show me the error of my ways in the fullness of time,
but I am skeptical.
>Thus, I have to reject Simon's contention that namespaces are
>anti-validation. It is true that *compound documents* pose big
>problems for document design in general and validation in
>particular. Compound documents, it is painfully obvious, are
>coming at us fast, and in high volume, so it behooves us to get
>our act together on document design. Namespaces, for the nonce,
>allow us to have compound documents without the elements falling
>over each other. But in and of themselves, they don't particularly
No, they don't impair validation, they simply make it impractical
to design document types that enable validation. I have never
been able to make sense out of Tim arguments on this matter,
and I still can't -- and it is not for lack of trying.
"Namespaces in XML" hate validation.
Shout it from the rooftops!
Murray Maloney, Esq. Phone: (905) 509-9120
Muzmo Communication Inc. Fax: (905) 509-8637
671 Cowan Circle Email: murray at muzmo.com
Pickering, Ontario Email: murray at yuri.org
Canada, L1W 3K6
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev