public final class XmlUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
JAXP_SCHEMA_LANGUAGE
JAXP Schema Language.
|
static String |
JAXP_SCHEMA_SOURCE
JAXP Schema Source.
|
static String |
W3C_XML_SCHEMA
W3C XML Schema.
|
| Modifier and Type | Method and Description |
|---|---|
static DocumentBuilder |
buildSecureDocumentBuilder()
Constructs a new document builder with security features enabled.
|
static SAXParser |
buildSecureSaxParser()
Constructs a secure SAX Parser.
|
static SAXParser |
buildSecureSaxParser(InputStream schemaStream)
Constructs a validating secure SAX Parser.
|
static String |
getPrettyParseExceptionInfo(SAXParseException ex)
Builds a prettier exception message.
|
public static final String JAXP_SCHEMA_LANGUAGE
public static final String W3C_XML_SCHEMA
public static final String JAXP_SCHEMA_SOURCE
public static SAXParser buildSecureSaxParser(InputStream schemaStream) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException, SAXException
schemaStream - the schema to validate the XML againstParserConfigurationException - is thrown if there is a parser
configuration exceptionSAXNotRecognizedException - thrown if there is an unrecognized
featureSAXNotSupportedException - thrown if there is a non-supported
featureSAXException - is thrown if there is a SAXExceptionpublic static SAXParser buildSecureSaxParser() throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException, SAXException
ParserConfigurationException - thrown if there is a parser
configuration exceptionSAXNotRecognizedException - thrown if there is an unrecognized
featureSAXNotSupportedException - thrown if there is a non-supported
featureSAXException - is thrown if there is a SAXExceptionpublic static DocumentBuilder buildSecureDocumentBuilder() throws ParserConfigurationException
ParserConfigurationException - thrown if there is a parser
configuration exceptionpublic static String getPrettyParseExceptionInfo(SAXParseException ex)
ex - the SAXParseExceptionCopyright? 2012-15 Jeremy Long. All Rights Reserved.