Package org.loboevolution.html.parser
Class XHtmlParser
java.lang.Object
org.loboevolution.html.parser.XHtmlParser
The XHtmlParser class is an HTML DOM parser. This parser provides
the functionality for the standard DOM parser implementation
DocumentBuilderImpl
. This parser class
may be used directly when a different DOM implementation is preferred.-
Field Summary
-
Constructor Summary
ConstructorDescriptionXHtmlParser
(UserAgentContext ucontext, Document document) Constructs a XHtmlParser.XHtmlParser
(UserAgentContext ucontext, Document document, boolean needRoot) Constructs a XHtmlParser. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isDecodeEntities
(String elementName) isDecodeEntities.void
parse
(LineNumberReader reader) parse.void
parse
(LineNumberReader reader, Node parent) This method may be used when the DOM should be built under a given node, such as when innerHTML is used in Javascript.void
Parses HTML given by a Reader.void
This method may be used when the DOM should be built under a given node, such as when innerHTML is used in Javascript.
-
Field Details
-
MODIFYING_KEY
Constant MODIFYING_KEY="cobra.suspend"- See Also:
-
-
Constructor Details
-
XHtmlParser
Constructs a XHtmlParser.- Parameters:
ucontext
- The user agent context.document
- A W3C Document instance.
-
XHtmlParser
Constructs a XHtmlParser.- Parameters:
ucontext
- The user agent context.document
- An W3C Document instance.needRoot
- a boolean.
-
-
Method Details
-
isDecodeEntities
isDecodeEntities.
- Parameters:
elementName
- aString
object.- Returns:
- a boolean.
-
parse
This method may be used when the DOM should be built under a given node, such as when innerHTML is used in Javascript.- Parameters:
reader
- A LineNumberReader for the document.parent
- The root node for the parsed DOM.- Throws:
IOException
- if any.SAXException
- if any.
-
parse
Parses HTML given by a Reader. This method appends nodes to the document provided to the parser.- Parameters:
reader
- An instance of Reader.- Throws:
IOException
- if any.SAXException
- if any.
-
parse
This method may be used when the DOM should be built under a given node, such as when innerHTML is used in Javascript.- Parameters:
reader
- A document reader.parent
- The root node for the parsed DOM.- Throws:
IOException
- if any.SAXException
- if any.
-
parse
parse.
- Parameters:
reader
- aLineNumberReader
object.- Throws:
IOException
- if any.SAXException
- if any.
-