DTD invented by Microsoft?!
Henry S. Thompson
ht at cogsci.ed.ac.uk
Thu Jun 26 11:44:53 BST 1997
> > Len wrote
> > > It is a bad idea and may be the reason SGML community
> > > members finally withdraw from XML development.
> Henry S. Thompson wrote:
> > I'd be interested to hear your reasons for thinking it's a bad idea --
> Why do we need two ways to do the same thing? Rick Jeliffe
> provided the example in the SGML DTD syntax we know now.
> If simplicity is the goal, why introduce this now?
Just because I can express any logical formula using Shaeffer stroke,
or any program in assembler, doesn't mean I should. Using PEs to
encode an element-type hierarchy not only obscures the author's
intention, it invites accidental error, encourages hacking at the
margins, and makes it harder for non-specialist users to augment the
hierarchy cleanly. Compare, for example
<!entity % x.phrase 'myCrystal |'>
<!element myCrystal (. . .)>
<elementType id='myCrystal' extends='#phrase'>
. . .
Understanding why and how the first of these does its work requires
considerable specialist knowledge, and if you don't believe me ask Lou
Burnard and Michael Sperberg-McQueen how easy they have found it to
educate TEI users to make such extensions themselves.
An explicit type hierarchy also simplifies things for the original
author, making the schema easier to maintain, to explain, and to read
for the ordinary user. Compare:
<!ENTITY % paraContent '(#PCDATA | %m.phrase | %m.inter)*' >
<!ENTITY % m.phrase '%x.phrase %m.data; . . .'>
<!ENTITY % a.global ' id ID #IMPLIED
. . .'>
<!ELEMENT p - O (%paraContent;) >
<!ATTLIST p %a.global;
TEIform CDATA 'p' >
<!elementType id='p' extends='#global'>
<attribute id='TEIform' presence='fixed' default='p'/>
. . .
<attribute name='id' type='id'>
. . .
Note finally that the PE method only easily allows a single layer of
specialisation -- once you've defined x.phrase in the above example,
you can't give the results to someone else and say "And to add stuff
to paragraph's content model, define x.phrase to what you want". If
you want to do that, you have to
<!define % x.phrase '%y.phrase myCrystal |'>
and so on. The element-type hierarchy approach allows multiple
independent specialisations, with a free choice of attachment points
(i.e. extends='phrase' or extends='myCrystal').
Hope this helps communicate the value I see in this approach.
xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo at ic.ac.uk the following message;
List coordinator, Henry Rzepa (rzepa at ic.ac.uk)
More information about the Xml-dev