[
Lists Home |
Date Index |
Thread Index
]
- From: John Cowan <cowan@locke.ccil.org>
- To: XML Dev <xml-dev@ic.ac.uk>
- Date: Thu, 25 Jun 1998 13:27:58 -0400
Chris Maden wrote:
> This seems unnecessarily verbose in the extreme. What's wrong with
The DTD is more verbose, but the actual instance isn't that much
more verbose. Empty elements involve only a few extra bytes over
attributes.
[attribute-based design snipped]
My original DTD was attribute-based: Ron convinced me (mostly by
example) that an element-based design was just as perspicuous.
Also, it involves less effort for a SAX-type parser (or for
that matter, for a DOM-based one), which has to return attribute
group objects whenever there are attributes.
> Here's where it gets interesting: Does XSchema have to limit itself to
> the capabilities of DTDs? If so, why bother? Think about this:
XSchema 1.0 does not have to support anything that DTD's don't.
However, it will be extensible, unlike DTDs.
> <XSC:AttDef Name="one-of-these" Type="IDRef" Required="Yes"
> Enumeration="index biblio gloss"/>
>
> You can't do that with DTDs. The value for one-of-these must be
> specified, and it must be a legitimate IDREF, but it is constrained to
> one of the specific IDs listed.
Forgive me, but I find this particular instance incomprehensible.
Why would you want to refer to only one of a specific set of IDs?
> Another example that someone in this group (one of the Peters?) raised
> is default ID names. This is illegal in XML 1.0, but for my <index>
> element, nine times out of ten, the ID is "index".
>
> <XSC:ElementDecl name="index">
> <!-- whatever content model -->
> <XSC:AttDef Name="id" Type="ID" Default="index"/>
> </XSC:ElementDecl>
IDs are assigned by the document creator, and the schema creator
is not supposed to arrogate specific values of them.
> Any time you have a huge slew of EMPTY elements, think that maybe they
> should be attributes.
Any time you have attributes, think that maybe they should be elements.
Any time you have elements (other than the root), think that maybe they
should be attributes.
> This gives less functionality than XML DTDs, since you can have
> multiple ATTLISTs for one element type.
I never understood what purpose this served, except to add new
attributes in the internal subset that weren't present in the
external subset, a valuable property indeed. (RDF documents,
to name one example, can't be validated without this capability,
because attributes can be added in data-dependent ways to elements defined by RDF itself.)
XSchema 1.0 has no notion of an internal subset.
> And BTW, I still don't like this capitalization method. I'm all for
> <xsc:attdef>; I do all my coding by hand (and so will everyone else,
> until an XSchema editor is written; don't hold your breath).
I rather agree with you, but the notion of conformity with the
XML spec is felt to be compelling.
--
John Cowan http://www.ccil.org/~cowan cowan@ccil.org
You tollerday donsk? N. You tolkatiff scowegian? Nn.
You spigotty anglease? Nnn. You phonio saxo? Nnnn.
Clear all so! 'Tis a Jute.... (Finnegans Wake 16.5)
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)
|