Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] TagSoup, malformed comments and XOM

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Bart Schuller <schuller+xom-interest AT lunatech.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] TagSoup, malformed comments and XOM
  • Date: Tue, 27 Jun 2006 22:53:24 +0200

Hi,

I have some nasty HTML to parse so I immediately tried out Tagsoup,
which produced a workable XML file. But when I tried building a XOM tree
in one step using the example from the nux page, I got an exception:

Exception in thread "main" nu.xom.ParsingException: Comment data
contains a double hyphen (--).

It turned out that the HTML had something like <!----- Here it is -->.

TagSoup deletes all comments when run from the commandline, so it
doesn't get noticed then.

It was easy enough build myself a NoCommentNodeFactory, but as it is,
the combination from the nux page does not "Just Keep On Truckin'".

Who's at fault here?
a) TagSoup, for reporting something an XML parser would never be able
to report, or
b) XOM, for not being robust/sleazy enough to change "--" to "- -" in
comments to be built or
c) the example "new Builder(new org.ccil.cowan.tagsoup.Parser())" for
being too simple?

I'm leaning towards a and maybe c.

Opinions?

--
Bart.




Archive powered by MHonArc 2.6.24.

Top of Page