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.
|
static boolean |
parseBoolean(String lexicalXSDBoolean)
Converts an attribute value representing an xsd:boolean value to a
boolean using the rules as stated in the XML specification.
|
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 - One or more inputStreams with the schema(s) that the
parser should be able to validate the XML against, one InputStream per
schemaParserConfigurationException - 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
org.xml.sax.SAXExceptionpublic static boolean parseBoolean(String lexicalXSDBoolean)
lexicalXSDBoolean - The string-value of the booleanlexicalXSDBooleanIllegalArgumentException - When lexicalXSDBoolean
does fit the lexical space of the XSD boolean datatypepublic 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
org.xml.sax.SAXExceptionpublic static DocumentBuilder buildSecureDocumentBuilder() throws ParserConfigurationException
ParserConfigurationException - thrown if there is
a parser configuration exceptionpublic static String getPrettyParseExceptionInfo(SAXParseException ex)
ex - the SAXParseExceptionCopyright © 2012–2020 OWASP. All rights reserved.