Package org.docx4j.org.apache.poi.util
Class XMLHelper
java.lang.Object
org.docx4j.org.apache.poi.util.XMLHelper
@Internal public final class XMLHelper extends java.lang.Object
Helper methods for working with javax.xml classes.
- See Also:
- OWASP XXE
-
Method Summary
Modifier and Type Method Description static javax.xml.parsers.DocumentBuilderFactorygetDocumentBuilderFactory()Creates a new DocumentBuilderFactory, with sensible defaultsstatic javax.xml.parsers.SAXParserFactorygetSaxParserFactory()static javax.xml.validation.SchemaFactorygetSchemaFactory()static javax.xml.transform.TransformerFactorygetTransformerFactory()static javax.xml.parsers.DocumentBuildernewDocumentBuilder()Creates a new document builder, with sensible defaultsstatic javax.xml.transform.TransformernewTransformer()static javax.xml.stream.XMLEventFactorynewXMLEventFactory()Creates a new StAX XMLEventFactory, with sensible defaultsstatic javax.xml.stream.XMLInputFactorynewXMLInputFactory()Creates a new StAX XMLInputFactory, with sensible defaultsstatic javax.xml.stream.XMLOutputFactorynewXMLOutputFactory()Creates a new StAX XMLOutputFactory, with sensible defaultsstatic org.xml.sax.XMLReadernewXMLReader()Creates a new SAX XMLReader, with sensible defaultsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
getDocumentBuilderFactory
public static javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()Creates a new DocumentBuilderFactory, with sensible defaults -
newDocumentBuilder
public static javax.xml.parsers.DocumentBuilder newDocumentBuilder()Creates a new document builder, with sensible defaults- Throws:
java.lang.IllegalStateException- If creating the DocumentBuilder fails, e.g. due toParserConfigurationException.
-
getSaxParserFactory
public static javax.xml.parsers.SAXParserFactory getSaxParserFactory() -
newXMLReader
public static org.xml.sax.XMLReader newXMLReader() throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationExceptionCreates a new SAX XMLReader, with sensible defaults- Throws:
org.xml.sax.SAXExceptionjavax.xml.parsers.ParserConfigurationException
-
newXMLInputFactory
public static javax.xml.stream.XMLInputFactory newXMLInputFactory()Creates a new StAX XMLInputFactory, with sensible defaults -
newXMLOutputFactory
public static javax.xml.stream.XMLOutputFactory newXMLOutputFactory()Creates a new StAX XMLOutputFactory, with sensible defaults -
newXMLEventFactory
public static javax.xml.stream.XMLEventFactory newXMLEventFactory()Creates a new StAX XMLEventFactory, with sensible defaults -
getTransformerFactory
public static javax.xml.transform.TransformerFactory getTransformerFactory() -
newTransformer
public static javax.xml.transform.Transformer newTransformer() throws javax.xml.transform.TransformerConfigurationException- Throws:
javax.xml.transform.TransformerConfigurationException
-
getSchemaFactory
public static javax.xml.validation.SchemaFactory getSchemaFactory()
-