> >***************************************** > > 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). > And if we'd kept the PI declaration syntax, none of those three steps would be necessary. In fact, now that I think about it, we really want a way to declare namespaces in the DTD, so we don't need to do a rewrite/normalization kluge which means that if you want to use namespaces and validate, expect your parser to crawl. At the same time, we really want prefix declarations within the DTD to have no effect in the instances (i.e., the instance is free to use its own set of prefixes), and vice versa. Otherwise, you'd have to read the DTD to check a well-formed namespace instance. This would indicate we can leave the current WD alone as far as instances are concerned, but could bring back the PI syntax for declarations within the external and internal subsets, with the understanding they have no impact on the rest of the instance (and vice versa). > 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. If we do what I just suggest above, the issue will be resolved, everyone will be happy, and we can start addressing more interesting issues. Matthew Fuchs matt@veosystems.com 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)