W3C home > Mailing lists > Public > www-tag@w3.org > April 2005

Re: XML validity and namespaces

From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Date: Sun, 03 Apr 2005 16:57:00 -0400
Message-ID: <4250589C.5030306@metalab.unc.edu>
To: www-tag <www-tag@w3.org>
Cc: Rich Salz <rsalz@datapower.com>

Rich Salz wrote:
> DTD's are ignorant of namespaces.  This means that you cannot write a
> normative DTD for a namespace (as you might do with XML Schema). The
> best you can hope to do is write something for expository purposes,
> using particular namespace prefixes as an example.  Each instance of
> a document would then have to rewrite the DTD to use the namespace
> prefixes that are used in the document.
> 

Actually you can do quite a bit better than that. It's possible to use 
parameter entity references such that the same DTD can be used for 
multiple prefixes and the default namespace. The most any instance 
document needs to do is override two parameter entity declarations. This 
is discussed and demonstrated in XML in a Nutshell and the XML 1.1 
Bible, and probably other sources. The technique is well-known and used 
by most W3C working groups that produce DTDs. It may have been invented 
by the MathML working group. In any case, that was the first place I saw 
it.

-- 
Elliotte Rusty Harold  elharo@metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
Received on Sunday, 3 April 2005 20:57:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:47:34 GMT