Summary of Namespaces and Validation

Tim Bray tbray at textuality.com
Thu Sep 10 19:25:26 BST 1998


At 11:30 AM 9/10/98 -0500, Mark Tucker wrote:
>*****************************************
>	Camp1 : Most of this Newsgroup 
>*****************************************
>		Documents with Namespaces can be validated provided
>		the prefix abbreviations are used consistently.

I don't think that too many people feel this way.  I hope not, because
the namespace draft makes it 100% clear that the prefix in and of itself
has no meaning, and is just a short-form stand-in to a URI.

>		DTD processors are un-aware of Namespaces.

True.

>	This camp seems to be equivalent to saying: 
>		"Treat <PN:NAME> as an XML ELEMENT tag with a colon in it."

This is all you can expect from an 8879-based DTD processor.

>*****************************************
>	Camp 2 : Tim Bray, Andrew Layman
>*****************************************
>		To validate a document that uses namespaces, do  all
>		the ELEMENT and ATTRIBUTE handling using the Expanded
>		Names.
>	This group thinks namespaces coexist with DTD's, provided
>	both the DTD and the document instance specify consistent
>	URI's for the namespaces. The actual prefix abbreviations
>	used in the DTD or the document instance don't matter.

Not quite right.  The prefixes are stand-ins for the URIs.  However,
the prefixes are all the DTD processor can see.  Thus, validating 
namespaced documents *has* to be a 3-step process.

1. Build a compound DTD that has prefixed declarations for all your
   elements and attributes.  This is the hard part.
2. Go through the instance and rewrite all the namespace declarations onto
   the root element and undo any defaulting, so that anything that's in
   a namespace has a prefix.  If necessary, rewrite the DTD so that the
   same URIs have the same prefixes in DTD and instance.  This is tedious
   but straightforward, there are dozens of programmers in this group
   who could sort it out in a day, given a decent XML processor.
3. Validate (or not, if the doc is broken).

What really bothers me is that discussion here keeps obsessing over the
tedious but straightforward problem of matching up prefixes, and nobody's
thinking about the interesting and difficult problem of compounding DTDs.
 -Tim


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;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list