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