Parsing of comments in LWP

Chet Murthy (chet@watson.ibm.com)
Mon, 13 May 1996 17:59:00 -0400


I decided to modify the HTML parser to preserve comment text.  I
thought I'd write down my strategy, in the hopes of getting whatever
feedback might be forthcoming.

The idea I have is to create a new node, with tag "!", witha single
attribute, "TEXT".  Then, the "starttag" function would emit the text
directly for this node.

Any function which needed to ignore comments could just skip this
node.

How does that sound?  To me, it's a bit baroque, but I can't think of
any other way to preserve comments, while treating them as
non-textual.

--chet--