Re: DTDs and XML Editors/Parsers

by "Donna M Smillie" <dms(at)zetnet.co.uk>

 Date:  Tue, 7 Mar 2000 00:33:46 -0000
 To:  "Murray Altheim" <altheim(at)eng.sun.com>
 Cc:  <hwg-gutenberg-dtds(at)hwg.org>
 References:  co sun
  todo: View Thread, Original
----- Original Message -----
From: Murray Altheim <altheim(at)eng.sun.com>

> The short answer is that I don't believe it *ever* prudent to
deliberately
> create a broken DTD to satisfy buggy software. Technical
correctness is what
> DTDs are all about, and they may serve as debugging tools for
such software
> as XML-based editors. And a broken DTD would certainly fail in
all other
> software that was actually XML conformant.

Wholeheartedly agree with you there, Murray - I hope I don't ever
suggest creating a broken DTD just to suit a particular piece of
software.

Problem I'm having in this instance is that the current DTD
syntax and the syntax proposed by the software I'm using *appear*
(to me at least) to be equally correct, just different.  If that
*is* the case, then I'm proposing that it's worth amending the
DTD construction so that the software out there can work with it
(but only within the constraint of it remaining a properly
constructed, valid DTD file).

Current DTD -

<!ENTITY % inline.class
"|quote|emph|ital|reference|date|place|name|graphic|txterr|mkuper
r|misc">
.....
<!ELEMENT acknowledge (#PCDATA %inline.class;)*>

Here, the entity declaration has "|" at the beginning of the
list, so that when the list for the "acknowledge" element is
expanded, there will be a "|" between "#PCDATA" and the rest of
the list.

Syntax proposed by XML Spy:

<!ENTITY % inline.class
"quote|emph|ital|reference|date|place|name|graphic|txterr|mkuperr
|misc">
.....
<!ELEMENT acknowledge (#PCDATA|%inline.class;)*>

This time, the "|" divider is present in the "acknowledge"
element declaration, rather than being part of the entity
declaration.

As far as I can see, both are equally correct - I've triple
checked the rest of the DTD and see nothing grossly wrong with
it.  Am I right in thinking that both forms are correct, or am I
missing some subtlety of syntax that makes the first format
preferable to the second?

To those of you experienced in DTD construction, this may seem
like such a simple question that you're looking for complexities
that don't in fact exist.  :-)  I'm still learning, and don't
want to suggest something that may cause problems down the line
because of some nuance I'm not aware of.

Thanks for your patience.  :-)

Regards,
Donna
--
dms(at)zetnet.co.uk
Different Worlds:  http://www.users.zetnet.co.uk/dms/
Pictures of the Past, The Leslie Smith Family,
An Introduction to HTML, Copyright Considerations
Online Bookshop

HWG: hwg-gutenberg-dtds mailing list archives, maintained by Webmasters @ IWA