Remember: namespaces break DTD's

To me, there is a compelling argument for  associating descriptions of some
flavor, be it DTDs or schemata, with namespaces: namespaces as they stand
break DTD's.  There are contorted ways, perhaps, of validating documents that
use the namespace notations, but not anything that is usable in practice.  The
idea of a single DTD for a multiplicity of documents simply doesn't work when
that DTD needs to contain different names according to the prefixes of the
namespaces it applies to.  In other words, if document A uses foo:z to refer
to element z of namespace N while document B uses bar:z to refer to element z
of namespace N, then A requires the DTD to describe foo:z while B requires it
to describe bar:z.  Of course, what we really want in the DTD is simply a
description of z with no prefixes at all.

keshlam@us.ibm.com wrote:

> Attributes of the form
>
>      xmlns-binding:namespace-prefix="associated-uri-reference"
>
> would be taken as declaring that the associated-uri-reference was associate
> with the namespace signified by the previously declared namespace-prefix.
> For example:
>      <myns:foo
>           xmlns:myns="http://my.namespace.name.com"
>           xmlns-binding:myns="#"/>
>
> would bind the relative URI reference "#" to the namespace name
> "http://my.namespace.name.com".
>
> The interpretation of that binding is not specified at this time (since I'm
> just trying to show an alternative to using the namespace name directly,
> and the meaning of that is likewise is unspecified).

That seems to me an excellent idea.  In particular, the xmlns-binding
mechanism could be used to specify a DTD whose names would be implicitly
prefixed with the namespace's prefix.  This arrangement works even when a
particular namespace is referred to within a single document via multiple
prefixes (and corresponding xmlns attributes); each prefix then defines an
implicit prefix for the DTD's names.

It appears that DTD's are somewhat out of fashion now, with schemata as the
intended replacement.   But remember -- they are still very much in XML 1.0.
In fact, they are the *only* type definition mechanism in XML 1.0.

Paul Abrahams

Received on Friday, 19 May 2000 23:09:46 UTC