Re: <IMAGE>? <TT> == <I>? toHell(NS)

Drazen Kacar (
Tue, 29 Oct 1996 14:17:38 +0100 (MET)

From: (Drazen Kacar)
Message-Id: <>
Subject: Re: <IMAGE>? <TT> == <I>? toHell(NS)
In-Reply-To: <> from David Perrell at "Oct 29, 96 00:27:20 am"
Date: Tue, 29 Oct 1996 14:17:38 +0100 (MET)

David Perrell wrote:
> Drazen Kacar wrote:
> > Hmmm... You can have italics on via style sheet and if </I> is a
> valid way
> > to turn it off than some people will have minor problems with
> expressing
> > this in DTD, I think. :)
> Yeah, I suppose that was an overly simplistic way of expressing
> implementation strategy. But we're talking broken markup, and I'm
> arguing that NSN's "guessing" gives fuzzy logic a bad name.
> If the italic attribute is turned on via some other means than the <I>
> tag then </I> certainly shouldn't turn it off. In a non-guessing
> implementation, the <I> tag -- whatever style is associated with it --
> could set a "state flag" when it is encountered and the flag could be
> unset when the </I> tag is encountered. If the </I> tag is encountered
> and the state flag for <I> is unset, do nothing. If the <I> tag is
> encountered and the state flag is already set, do nothing. Just a
> thought.

There is a question of the scope of that flag. In Cougar DTD you'll find

<!ENTITY % font "TT | I | B  | U | S | BIG | SMALL | SUB | SUP">
<!ENTITY % text "#PCDATA | %font | %phrase | %special | %form">
<!ELEMENT (%font|%phrase) - - (%text)*>

which means that "<I>here <I>is</I> italics</I>" is perfectly legal and all of
it should be rendered in italics. You'll need a stack machine for that, but
you need it for style sheets anyway.

Error recovery is usually a nightmare business. :) You'll want to do something
sensible with nestings like "<B>and now <I>for something</B> completely
different</I>". If nothing else, you have to empty your stack. There is a
simple way to do it, just drop anything that's out of context, but this will
cause major problems with some pages.  A few months ago, on Lycos advanced
search page, there was this construct:


I suppose it worked with NSN and MSIE, but Lynx terminated FORM context and
was unable to send a query. I don't know if they still have that on the page.

A couple of years ago, when I was trying hard to learn a thing or two about
compiler design theory, I encountered a reference to a very interesting work
in the field. Somebody managed to make a compiler that could change the
errorneous source file into something syntactically correct in a finite
number of steps. This won't help the person who is using a compiler much, but
the compiler won't choke and abandon compilation because too many errors are
encountered. That work showed it is possible, but it required too much
resources and the idea was abandoned. What seemed like too much resources at
that time might not be too much today and if anyone is interested, perhaps
I can dig up the reference.

Life is a sexually transmitted disease.