public final class HtmlUnitNekoHtmlParser extends Object implements HTMLParser
SAX parser implementation that uses the NekoHTML HTMLConfiguration
to parse HTML into a HtmlUnit-specific DOM (HU-DOM) tree.
Modifier and Type | Field and Description |
---|---|
static SvgElementFactory |
SVG_FACTORY
The SVG factory.
|
Constructor and Description |
---|
HtmlUnitNekoHtmlParser() |
Modifier and Type | Method and Description |
---|---|
ElementFactory |
getElementFactory(SgmlPage page,
String namespaceURI,
String qualifiedName,
boolean insideSvg,
boolean svgSupport)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
ElementFactory |
getFactory(String tagName)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
ElementFactory |
getSvgFactory()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
parse(WebResponse webResponse,
HtmlPage page,
boolean xhtml,
boolean createdByJavascript)
Parses the WebResponse into an object tree representation.
|
void |
parseFragment(DomNode parent,
DomNode context,
String source,
boolean createdByJavascript)
Parses the HTML content from the given string into an object tree representation.
|
void |
parseFragment(DomNode parent,
String source)
Parses the HTML content from the given string into an object tree representation.
|
public static final SvgElementFactory SVG_FACTORY
public void parseFragment(DomNode parent, String source) throws SAXException, IOException
parseFragment
in interface HTMLParser
parent
- the parent for the new nodessource
- the (X)HTML to be parsedSAXException
- if a SAX error occursIOException
- if an IO error occurspublic void parseFragment(DomNode parent, DomNode context, String source, boolean createdByJavascript) throws SAXException, IOException
parseFragment
in interface HTMLParser
parent
- where the new parsed nodes will be added tocontext
- the context to build the fragment context stacksource
- the (X)HTML to be parsedcreatedByJavascript
- if true the (script) tag was created by javascriptSAXException
- if a SAX error occursIOException
- if an IO error occurspublic void parse(WebResponse webResponse, HtmlPage page, boolean xhtml, boolean createdByJavascript) throws IOException
parse
in interface HTMLParser
webResponse
- the response datapage
- the HtmlPage to add the nodesxhtml
- if true use the XHtml parsercreatedByJavascript
- if true the (script) tag was created by javascriptIOException
- if there is an IO errorpublic ElementFactory getSvgFactory()
getSvgFactory
in interface HTMLParser
public ElementFactory getFactory(String tagName)
getFactory
in interface HTMLParser
tagName
- an HTML element tag namepublic ElementFactory getElementFactory(SgmlPage page, String namespaceURI, String qualifiedName, boolean insideSvg, boolean svgSupport)
getElementFactory
in interface HTMLParser
page
- the pagenamespaceURI
- the namespace URIqualifiedName
- the qualified nameinsideSvg
- is the node inside an SVG node or notsvgSupport
- true if called from javascript createElementNSCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.