public class XmlUtil extends Object
| Constructor and Description |
|---|
XmlUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.jdom.Document |
createJDOMDocument(Document document)
Creates a JDOM
Document from a specified
W3C Document. |
static String |
createStringFromJDOMDocument(org.jdom.Document document)
Returns the documents XML content as a string.
|
static org.jdom.Element |
getBodyFragmentFromJDOMDocument(org.jdom.Document document)
Convinience method for HTML fragments.
|
static org.jdom.Element |
getBodyFragmentJDOMDocument(org.jdom.Document document)
Deprecated.
|
static org.apache.xerces.parsers.DOMParser |
getHTMLParser()
Returns a parser suitable for parsing HTML documents.
|
static Document |
parse(org.apache.xerces.parsers.DOMParser parser,
String source)
Parses the specified XML with the specified parser.
|
static Document |
parseHTML(String source)
Parses the specified HTML with the NekoHTML parser.
|
public static org.jdom.Element getBodyFragmentFromJDOMDocument(org.jdom.Document document)
Element.
If an HTML documents looks like this:
<html> <head> </head> <body> <h1> </h1> </body> </html>the method returns the h1 tag as
Element.document - the org.jdom.DocumentElementpublic static org.jdom.Element getBodyFragmentJDOMDocument(org.jdom.Document document)
getBodyFragmentFromJDOMDocument(org.jdom.Document)document - the document to get the body frompublic static String createStringFromJDOMDocument(org.jdom.Document document)
document - the org.jdom.Documentpublic static org.jdom.Document createJDOMDocument(Document document)
Document from a specified
W3C Document.document - the org.w3c.dom.Documentorg.jdom.Documentpublic static org.apache.xerces.parsers.DOMParser getHTMLParser()
parseHTML(java.lang.String).org.apache.xerces.parsers.DOMParser
with Neko configurationpublic static Document parseHTML(String source)
parse method.source - the HTML as Stringpublic static Document parse(org.apache.xerces.parsers.DOMParser parser, String source)
parseHTML(java.lang.String).parser - the parser (must extend
org.apache.xerces.parsers.DOMParser),
e.g. the one returned by getHTMLParser()source - the XML as StringCopyright © 2003–2018. All rights reserved.