Skip to main content.
home | support | download

Back to List Archive

Re: [SWISH-E:368] Re: How to ignore <!DOCTYPE ...>?

From: Marjolein Katsma <webmaster(at)not-real.javawoman.com>
Date: Wed Jul 15 1998 - 10:28:24 GMT
Roy,

At 16:34 1998-07-14 -0700, Roy Tennant wrote:
>
>The 1.2 version of SWISH-Enhanced (due out as soon as I can get the
>documentation together), enables a configuration switch that can ignore
>the contents of "comments", which would include DOCTYPE declarations. 

I'm afraid that would be incorrect - in fact just as incorrect as the
current version.
"Comments" by definition do not include DOCTYPE declarations.

A comment tag can contain any number of comments (including zero), each
enclosed in pairs of -- --; anything with <! and > that is not enclosed in
a pair of -- -- is not a comment; whitespace before the first -- is not
allowed. Comments should be treated as comments, DOCTYPE declarations
should be treated as any other tag (i.e., indexed only if the flag
INDEXTAGS is set to 1).

As a simple crutch (until proper comment parsing is implemented), you can
detect a comment as starting with "<!--" rather than just "<!" which (in
combination with the new flag to ignore comments if desired) should have
the intended effect in most cases - including properly ignoring DOCTYPE
declarations even if comments are not set to be ignored.
That crutch will of course only work as long as comments do not actually
include markup, which is allowed by the definition of comment: a comment
can contain *anything* except --.

BTW, you can see this crutch in operation in the code I sent to Giulia Hill...

Cheers,

Marjolein Katsma      webmaster@javawoman.com
Java Woman - http://javawoman.com/
Received on Wed Jul 15 03:38:02 1998