Class TolerantSaxDocumentBuilder

  • All Implemented Interfaces:
    ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler

    public class TolerantSaxDocumentBuilder
    extends DefaultHandler
    implements LexicalHandler
    Uses Sax events from the ContentHandler and LexicalHandler interfaces to build a DOM document in a tolerant fashion -- it can cope with start tags without end tags, and end tags without start tags for example. Although this subverts the idea of XML being well-formed, it is intended for use with HTML pages so that they can be transformed into DOM trees, without being XHTML to start with. Note that this class currently does not handle entity, DTD or CDATA tags.
    See Also:
    HTMLDocumentBuilder.parse(java.io.Reader)