Date: Tue, 13 Jan 1998 09:58:12 -0800
From: "W. Eliot Kimber" <>
Organization: ISOGEN International Corp.
Subject: Re: DOCTYPE (was Re: Announcement: SAX 1998-01-12 Draft)


Peter Murray-Rust wrote:
> In conclusion (IMO) the DOCTYPE statement really only serves to
> identify
> the address of the external subset. It is equivalent to:
> <!ENTITY % foo "foo.dtd">
> %foo;
> ]>

Exactly correct. The DOCTYPE declaration tells you *nothing* about the
abstract type of the document (that is, the general class of documents
of which the author intended it to be an instance).

> How do we determine the TYPE of a document?  There is no good
> mechanism.

Not true.  All that is necessary is to provide some way to point to a
separate definition of the type.  The SGML architecture mechanism,
defined in ISO/IEC 10744:1997 and implemented in the SP parsers (as well
as in purpose-built code) provides just such a mechanism.  In December,
James and I submitted for WG4 approval an enhancement to the formal
mechanism that lets it be used with XML documents. See

The idea is a simple one: you use a PI to associate a local name for the
"type" and then use a URL or public identifier to point to the
documentation and the DTD that defines the type.

For example, ISOGEN has defined for its own use a base architecture from
which a variety of specific document types can be derived.  I can invoke
the use of this architecture like so:

<?XML 1.0 ?>
  public-id="+//IDN ISOGEN Base Architecture//EN"
<foo ISOBase="paragraph">Foo is now clearly a kind of ISOBase

By default, the architecture ("type") name is used as the name of the
attribute you use to map local elements to element types in the
architecture (which types you can determine by looking at the
architectural DTD).

Note that the presence or absence of a DOCTYPE declaration is
irrelevant--all the information you need to interpret the Foo element as
an ISOBase paragraph is in the instance.  The only think a DOCTYPE
declaration would add would be the convenience of setting a default
value for the ISOBase attribute.

Note also that it requires no parser-level code to interpret and support
the mapping because it's using normal XML syntax: PIs and attributes. 
It also doesn't require anything like the colonized names because the
name mapping is done through an attribute, which has the advantage that
the same element can be mapped to different architectures at the same
time.  For example, I might want to also indicate that the Foo element
corresponds to something in the RDF spec:

<?XML 1.0 ?>
  public-id="+//IDN ISOGEN Base Architecture//EN"
  public-id="+//IDN Resource Definition Format//EN"
<foo ISOBase="paragraph" rdf="some-rdf-element-type"
>Foo is now clearly a kind of ISOBase paragraph</foo>

When you're doing ISOBase-related processing, you ignore the RDF mapping
and when you're doing RDF-related processing you ignore the ISOBase
mapping.  Or, you can consider both at once, it's up to your processor.

The document can be validated against either of the architectural DTDs
by using a tool like SP, which has that facility built in, or by
explicitly generating the document that reflects the mapping and then
validating it against the architectural DTD.  For example, the ISOBase
"architectural instance" of the above is:

<?XML 1.0?>
<!DOCTYPE paragraph SYSTEM "">
<paragraph>Foo is now clearly a kind of ISOBase paragraph</paragraph>

That's all there is to it.  The idea that DOCTYPE declarations tell you
something useful is one of the top five Big Lies of SGML.

For more on the subject of architectures, see, which goes into more
detail about using architectures within an XML context.

If anyone would like to see real code that does architecture-based
processing, I would be happy to provide it in any of the languages in
which I've done it (Perl, Rexx, DSSSL, ACL, VisualBasic--sorry, no Java,
only because I haven't had a need to do Java programming yet--note the
preponderance of *interpreted* languages in this list :-).



xml-dev: A list for W3C XML Developers. To post,
Archived as:
To (un)subscribe, the following message;
(un)subscribe xml-dev
To subscribe to the digests, the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (