XSD: Document instance syntax goal

Paul Prescod (papresco@technologist.com)
Tue, 26 May 1998 14:58:52 -0400


Simon St.Laurent wrote:
>
> 1. SDDs shall use XML document syntax.

This is a little more vague than I would prefer. Here's a DTD-like schema
in document syntax notation:

<?XML version="1.0"?>
<SCHEMA>
<![CDATA[
<!ELEMENT ...>
<!ATTLIST ...>
]]>
</SCHEMA>

This is an exaggeration, because we aren't likely to do that, but we might
be tempted to use #PCDATA for content models.

The essential point, I think, is that SDDs should use element nesting and
XLinks to describe *all* constraints that should be checkable by the
computer. The only required character data should be descriptions of
things. The only CDATA attributes should be XLinks.

Perhaps for version 2.0 it would make sense to have an optional encoding
that uses #PCDATA content models etc. I don't think that it is so terrible
to require tool vendors to build small parsers inside of their XML
applications. XPointers require that, for instance. But it is better to
use element nesting for version 1.0:

* Implementation is easier, because the API is predictable (element
events in SAX or element nodes in DOM)
* Rigorous specification is easier, because we don't need to have BOTH a
DTD and a BNF to describe SDDs
* A DTD smart editor can guide SDD creation "all of the way down".

Paul Prescod - http://itrc.uwaterloo.ca/~papresco

Three things to be wary of: A new kid in his prime
A man who knows the answers, and code that runs first time
http://www.geezjan.org/humor/computers/threes.html