org.custommonkey.xmlunit
public class TolerantSaxDocumentBuilder extends DefaultHandler implements LexicalHandler
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
Constructor Summary | |
---|---|
TolerantSaxDocumentBuilder(DocumentBuilder documentBuilder)
Constructor for specific JAXP parser |
Method Summary | |
---|---|
void | characters(char[] data, int start, int end)
ContentHandler method. |
void | comment(char[] ch, int start, int length)
LexicalHandler method |
void | endCDATA()
Unhandled LexicalHandler method |
void | endDocument()
ContentHandler method |
void | endDTD()
Unhandled LexicalHandler method |
void | endElement(String namespaceURI, String localName, String qName)
ContentHandler method |
void | endEntity(String name)
Unhandled LexicalHandler method |
void | endPrefixMapping(String prefix)
Unhandled ContentHandler method |
Document | getDocument() |
String | getTrace() |
void | ignorableWhitespace(char[] ch, int start, int length)
Unhandled ContentHandler method |
void | processingInstruction(String target, String data)
ContentHandler method |
void | setDocumentLocator(Locator locator)
Unhandled ContentHandler method |
void | skippedEntity(String name)
Unhandled ContentHandler method |
void | startCDATA()
Unhandled LexicalHandler method |
void | startDocument()
ContentHandler method |
void | startDTD(String name, String publicId, String systemId)
Unhandled LexicalHandler method.
|
void | startElement(String namespaceURI, String localName, String qName, Attributes atts)
ContentHandler method |
void | startEntity(String name)
Unhandled LexicalHandler method |
void | startPrefixMapping(String prefix, String uri)
Unhandled ContentHandler method |
Parameters: documentBuilder the JAXP parser to use to construct an empty DOM document that will be built up with SAX calls
Throws: ParserConfigurationException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Returns: the Document built up through the Sax calls
Returns: the trace of Sax calls that were used to build up the Document
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException
Throws: SAXException