java.lang.Object
org.openpdf.text.xml.simpleparser.SimpleXMLParser
A simple XML and HTML parser. This parser is, like the SAX parser, an event based parser, but with much less
functionality.
The parser can:
- It recognizes the encoding used
- It recognizes all the elements' start tags and end tags
- It lists attributes, where attribute values can be enclosed in single or double quotes
- It recognizes the
<[CDATA[ ... ]]>
construct - It recognizes the standard entities: &, <, >, ", and ', as well as numeric entities
- It maps lines ending in
\r\n
and\r
to\n
on input, in accordance with the XML Specification, Section 2.11
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
parse
(SimpleXMLDocHandler doc, InputStream in) Parses the XML document firing the events to the handler.static void
parse
(SimpleXMLDocHandler doc, Reader r) static void
parse
(SimpleXMLDocHandler doc, SimpleXMLDocHandlerComment comment, Reader r, boolean html) Parses the XML document firing the events to the handler.
-
Method Details
-
parse
public static void parse(SimpleXMLDocHandler doc, SimpleXMLDocHandlerComment comment, Reader r, boolean html) throws IOException Parses the XML document firing the events to the handler.- Parameters:
doc
- the document handlercomment
-comment
r
- the document. The encoding is already resolved. The reader is not closedhtml
-html
- Throws:
IOException
- on error
-
parse
Parses the XML document firing the events to the handler.- Parameters:
doc
- the document handlerin
- the document. The encoding is deduced from the stream. The stream is not closed- Throws:
IOException
- on error
-
parse
- Throws:
IOException
-