public final class DocumentHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addNamespaceDeclaration(Element element,
Namespace namespace)
Adds a namespace declaration attribute to the given element.
|
static void |
addNamespaceDeclaration(Element element,
String namespacePrefix,
String namespaceURI)
Adds a namespace declaration attribute to the given element.
|
static Document |
createDocument()
Creates a new DOM Document
|
static DocumentBuilder |
newDocumentBuilder()
Creates a new document builder, with sensible defaults
|
static Document |
readDocument(InputSource inp)
Parses the given stream via the default (sensible)
DocumentBuilder
|
static Document |
readDocument(InputStream inp)
Parses the given stream via the default (sensible)
DocumentBuilder
|
public static DocumentBuilder newDocumentBuilder()
public static Document readDocument(InputStream inp) throws IOException, SAXException
inp - Stream to read the XML data fromIOExceptionSAXExceptionpublic static Document createDocument()
public static void addNamespaceDeclaration(Element element, String namespacePrefix, String namespaceURI)
public static void addNamespaceDeclaration(Element element, Namespace namespace)
public static Document readDocument(InputSource inp) throws IOException, SAXException
inp - sax source to read the XML data fromIOExceptionSAXExceptionCopyright © 2020. All rights reserved.