Re: end tags...

Carl Morris <msftrncs@htcnet.com> writes:
>|     <!ENTITY % heading "H1|H2|H3|H4|H5|H6">
>| [...]
>|     <!ELEMENT ( %heading )  - -  (%text;)*>
>|
>| Big difference. The "- -" in H1-H6 means both start and end tags are
>required.
>|
>|     <!ELEMENT P     - O (%text)*>
>|
>| The "- O" in P means the end tag is optional. Arnoud is correct: the
>STYLE
>| element requires an end tag, so the given example is invalid.
>
>See, I told people this DTD is "crap"... whats wrong wiuth REQUIRED or
>OPTIONAL, no, they using numbers ... just to make sure little people
>like me won't learn it...

You really need to get a handle on your anger -- there is no conspiracy. In
previous messages you've mentioned you understand programming languages.
Try leaving a semicolon off of the end of a C statement. The particular
syntax of a DTD is no more arcane than C or SmallTalk or Lisp or HyperTalk
-- it's just different. I learned DTD syntax in about a month, and I'm no
genius.

>So do you advise browsers to throw a tantraum or to be intellegent and
>bypass the error knowning what was meant?

I would advise browsers to let users know when it has encountered a
document that is not valid/is not understood, maybe just a little icon that
has a check mark if valid and an "X" if not. Not obtrusive. The problem is
twofold: a browser is not a validator (nor should it be), and it's the
responsibility of browsers to handle bad content, not choke on it. But upon
encountering an error, it's impossible to assume "what was meant". The
general nature of parsing errors is their ambiguity.

>(as I said earlier, I see no reason why most all end tags can not be
>assumed...)

Many can be assumed, hence the DTD's declaring them as optional. For
others, the lack of and end tag creates an ambiguity that cannot be
remedied.

Murray

```````````````````````````````````````````````````````````````````````````````
     Murray Altheim, Program Manager
     Spyglass, Inc., Cambridge, Massachusetts
     email: <mailto:murray@spyglass.com>
     http:  <http://www.cambridge.spyglass.com/murray/murray.html>
            "Give a monkey the tools and he'll eventually build a typewriter."

Received on Sunday, 22 September 1996 17:52:16 UTC