Package org.custommonkey.xmlunit
Class HTMLDocumentBuilder
java.lang.Object
org.custommonkey.xmlunit.HTMLDocumentBuilder
Build a DOM document from HTML content converting from 'plain' HTML into
'XHTML' along the way with the help of a TolerantSaxDocumentBuilder and
the Swing html parser classes.
This allows XML assertions to be made against badly formed HTML.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassAdapts Swing HTML callback messages to Sax equivalents, passing them to a Sax-aware ContentHandler. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final HTMLDocumentBuilder.SwingEvent2SaxAdapterprotected final TolerantSaxDocumentBuilderprivate final StringBuilder -
Constructor Summary
ConstructorsConstructorDescriptionHTMLDocumentBuilder(TolerantSaxDocumentBuilder tolerantSaxDocumentBuilder) Constructor -
Method Summary
-
Field Details
-
tolerantSaxDocumentBuilder
-
swingEvent2SaxAdapter
-
traceBuilder
-
-
Constructor Details
-
HTMLDocumentBuilder
Constructor- Parameters:
tolerantSaxDocumentBuilder- the instance that will receive SAX calls generated as the HTML is parsed and build up a DOM Document
-
-
Method Details
-
parse
- Returns:
- a DOM document parsed from the Reader via an SwingEvent2SaxAdapter and TolerantSaxBuilder. Not thread-safe!
- Throws:
SAXExceptionIOException- See Also:
-
parse
- Returns:
- a DOM document parsed from the String via an SwingEvent2SaxAdapter and TolerantSaxBuilder. Not thread-safe!
- Throws:
SAXExceptionIOException- See Also:
-
getTrace
- Returns:
- the trace of events and / or warnings encountered during parsing
-
trace
Append to the log built up during parsing- Parameters:
msg- what to append
-