[jdom-interest] Re: Non well-formedness checking parser (was Re: [jdom-interest] don't validate comments)

Elliotte Rusty Harold elharo at metalab.unc.edu
Fri Dec 6 15:30:25 PST 2002

At 4:59 PM +0000 12/5/02, Robert (Jamie) Munro wrote:

>How can ResultSetBuilder exist then? That can't possibly be compliant with
>the XML spec.

ResultSetBuilder is a horse of a different color. It doesn't parse 
XML at all. It builds a JDOM object from something that isn't XML. 
However, if you're going to read something that purports to be XML, 
the parser is absolutely required to throw a fatal error when a 
well-formedness error is found. (The exact definition of fatal error 
varies depending on local environment. In our case, a checked 
exception suffices.) Parsers are specifically not allowed to fix the 
error and continue parsing. There is no wiggle room in the XML spec 
on this point, and that's a good thing.

| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |

More information about the jdom-interest mailing list