Package org.apache.hadoop.util
Class XMLUtils
java.lang.Object
org.apache.hadoop.util.XMLUtils
General xml utilities.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentBuilderFactoryThis method should be used if you need aDocumentBuilderFactory.static SAXParserFactoryThis method should be used if you need aSAXParserFactory.static SAXTransformerFactoryThis method should be used if you need aSAXTransformerFactory.static TransformerFactoryThis method should be used if you need aTransformerFactory.static voidtransform(InputStream styleSheet, InputStream xml, Writer out) Transform input xml given a stylesheet.
-
Field Details
-
DISALLOW_DOCTYPE_DECL
- See Also:
-
LOAD_EXTERNAL_DECL
- See Also:
-
EXTERNAL_GENERAL_ENTITIES
- See Also:
-
EXTERNAL_PARAMETER_ENTITIES
- See Also:
-
CREATE_ENTITY_REF_NODES
- See Also:
-
VALIDATION
- See Also:
-
-
Constructor Details
-
XMLUtils
public XMLUtils()
-
-
Method Details
-
transform
public static void transform(InputStream styleSheet, InputStream xml, Writer out) throws TransformerConfigurationException, TransformerException Transform input xml given a stylesheet.- Parameters:
styleSheet- the style-sheetxml- input xml dataout- output- Throws:
TransformerConfigurationException- synopsis signals a problem creating a transformer object.TransformerException- this is used for throwing processor exceptions before the processing has started.
-
newSecureDocumentBuilderFactory
public static DocumentBuilderFactory newSecureDocumentBuilderFactory() throws ParserConfigurationExceptionThis method should be used if you need aDocumentBuilderFactory. Use this method instead ofDocumentBuilderFactory.newInstance(). The factory that is returned has secure configuration enabled.- Returns:
- a
DocumentBuilderFactorywith secure configuration enabled - Throws:
ParserConfigurationException- if theJAXPparser does not support the secure configuration
-
newSecureSAXParserFactory
public static SAXParserFactory newSecureSAXParserFactory() throws SAXException, ParserConfigurationExceptionThis method should be used if you need aSAXParserFactory. Use this method instead ofSAXParserFactory.newInstance(). The factory that is returned has secure configuration enabled.- Returns:
- a
SAXParserFactorywith secure configuration enabled - Throws:
ParserConfigurationException- if theJAXPparser does not support the secure configurationSAXException- if there are another issues when creating the factory
-
newSecureTransformerFactory
public static TransformerFactory newSecureTransformerFactory() throws TransformerConfigurationExceptionThis method should be used if you need aTransformerFactory. Use this method instead ofTransformerFactory.newInstance(). The factory that is returned has secure configuration enabled.- Returns:
- a
TransformerFactorywith secure configuration enabled - Throws:
TransformerConfigurationException- if theJAXPtransformer does not support the secure configuration
-
newSecureSAXTransformerFactory
public static SAXTransformerFactory newSecureSAXTransformerFactory() throws TransformerConfigurationExceptionThis method should be used if you need aSAXTransformerFactory. Use this method instead ofTransformerFactory.newInstance(). The factory that is returned has secure configuration enabled.- Returns:
- a
SAXTransformerFactorywith secure configuration enabled - Throws:
TransformerConfigurationException- if theJAXPtransformer does not support the secure configuration
-