[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DTDs and namespaces (was: using namespaces to version)
- From: Wayne Steele <xmlmaster@hotmail.com>
- To: cmsmcq@acm.org, xml-dev@lists.xml.org
- Date: Tue, 08 May 2001 11:40:46 -0700
One could, if one wanted, define an extension mechanism to allow for
different kinds of processors to interpret DTDs differently, and yet
faithfully preserve the meaning and syntax of DTDs as per XML 1.0.
This still won't support the "Full Generality" of namespace constructs in
the instance documents, except for processors that buy into the appropriate
extension mechanism. But it could allow for the same DTD to be useful to XML
1.0 spec-as-written processors.
I despair of anyone getting excited enough to implement this, but it would
work like this:
<?DTD-EX
http://example.int/namespace.extension.for.dtds
<!ENTITY % legacy "IGNORE" >
<!ENTITY % ns_aware "INCLUDE" >
?>
<!ENTITY % legacy "INCLUDE" >
<!ENTITY % ns-aware "IGNORE" >
<![%legacy;[
<!-- let's use the parameter entity trick -->
<!-- introduced in the DTD for XML Schema -->
<!ENTITY % prefix_a 'a:' >
<!ENTITY % suffix_a ':a' >
<!ENTITY % a '%prefix_a;a' >
<!ENTITY % a_nsdecl 'xmlns%suffix_a;' >
<!ELEMENT %a; (#PCDATA)* >
<!ATTLIST %a; %a_nsdecl; CDATA #IMPLIED >
]]>
<![%ns-aware;[
<?xmlns prefix="A" uri="uri:foobar" ?>
<!ELEMENT A:x (#PCDATA)* >
<!-- since we know all about namespaces -->
<!-- there's no need to declare the xmlns:* attribute -->
]]>
-Wayne Steele
>From: "C. M. Sperberg-McQueen" <cmsmcq@acm.org>
>
>In sum, we appear to be in emphatic agreement. If one is willing to
>change the rules for interpreting DTDs and validating documents
>against them, one can use DTD notation to define sets of documents
>which use namespaces. ... Otherwise, only with restrictions
>on the use of namespace prefixes ... C. M. Sperberg-McQueen
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com