Package org.apache.xmlbeans.impl.common
Class DocumentHelper
- java.lang.Object
-
- org.apache.xmlbeans.impl.common.DocumentHelper
-
public final class DocumentHelper extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.w3c.dom.Document
createDocument()
Creates a new DOM Documentstatic javax.xml.parsers.DocumentBuilder
newDocumentBuilder(XmlOptionsBean xmlOptions)
Creates a new document builder, with sensible defaultsstatic org.w3c.dom.Document
readDocument(XmlOptionsBean xmlOptions, java.io.InputStream inp)
Parses the given stream via the default (sensible) DocumentBuilderstatic org.w3c.dom.Document
readDocument(XmlOptionsBean xmlOptions, org.xml.sax.InputSource inp)
Parses the given stream via the default (sensible) DocumentBuilder
-
-
-
Method Detail
-
newDocumentBuilder
public static javax.xml.parsers.DocumentBuilder newDocumentBuilder(XmlOptionsBean xmlOptions)
Creates a new document builder, with sensible defaults- Parameters:
xmlOptions
-- Throws:
java.lang.IllegalStateException
- If creating the DocumentBuilder fails, e.g. due toParserConfigurationException
.
-
readDocument
public static org.w3c.dom.Document readDocument(XmlOptionsBean xmlOptions, java.io.InputStream inp) throws java.io.IOException, org.xml.sax.SAXException
Parses the given stream via the default (sensible) DocumentBuilder- Parameters:
inp
- Stream to read the XML data from- Returns:
- the parsed Document
- Throws:
java.io.IOException
org.xml.sax.SAXException
-
readDocument
public static org.w3c.dom.Document readDocument(XmlOptionsBean xmlOptions, org.xml.sax.InputSource inp) throws java.io.IOException, org.xml.sax.SAXException
Parses the given stream via the default (sensible) DocumentBuilder- Parameters:
inp
- sax source to read the XML data from- Returns:
- the parsed Document
- Throws:
java.io.IOException
org.xml.sax.SAXException
-
createDocument
public static org.w3c.dom.Document createDocument()
Creates a new DOM Document
-
-