public final class HTMLParser extends Object
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 String |
XHTML_NAMESPACE
XHTML namespace.
|
Modifier and Type | Method and Description |
---|---|
static IElementFactory |
getFactory(String tagName) |
static boolean |
getIgnoreOutsideContent()
Deprecated.
As of 2.6 without replacement (HtmlUnit tries to mimic browser's
behavior and browsers don't ignore outside content)
|
static HtmlPage |
parse(WebResponse webResponse,
WebWindow webWindow)
Deprecated.
as of version 2.6, please use
parseHtml(WebResponse, WebWindow) instead |
static void |
parseFragment(DomNode parent,
String source)
Parses the HTML content from the given string into an object tree representation.
|
static HtmlPage |
parseHtml(WebResponse webResponse,
WebWindow webWindow)
Parses the HTML content from the specified WebResponse into an object tree representation.
|
static XHtmlPage |
parseXHtml(WebResponse webResponse,
WebWindow webWindow)
Parses the XHTML content from the specified WebResponse into an object tree representation.
|
static void |
setIgnoreOutsideContent(boolean ignoreOutsideContent)
Deprecated.
As of 2.6 without replacement (HtmlUnit tries to mimic browser's
behavior and browsers don't ignore outside content)
|
public static final String XHTML_NAMESPACE
@Deprecated public static void setIgnoreOutsideContent(boolean ignoreOutsideContent)
ignoreOutsideContent
- - boolean flag to set@Deprecated public static boolean getIgnoreOutsideContent()
public static IElementFactory getFactory(String tagName)
tagName
- an HTML element tag namepublic static void parseFragment(DomNode parent, String source) throws SAXException, IOException
parent
- the parent for the new nodessource
- the (X)HTML to be parsedSAXException
- if a SAX error occursIOException
- if an IO error occurs@Deprecated public static HtmlPage parse(WebResponse webResponse, WebWindow webWindow) throws IOException
parseHtml(WebResponse, WebWindow)
insteadwebResponse
- the response datawebWindow
- the web window into which the page is to be loadedIOException
- if there is an IO errorpublic static HtmlPage parseHtml(WebResponse webResponse, WebWindow webWindow) throws IOException
webResponse
- the response datawebWindow
- the web window into which the page is to be loadedIOException
- if there is an IO errorpublic static XHtmlPage parseXHtml(WebResponse webResponse, WebWindow webWindow) throws IOException
webResponse
- the response datawebWindow
- the web window into which the page is to be loadedIOException
- if there is an IO errorCopyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.