public final class XmlUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JAXP_SCHEMA_LANGUAGE
JAXP Schema Language.
|
static java.lang.String |
JAXP_SCHEMA_SOURCE
JAXP Schema Source.
|
static java.lang.String |
W3C_XML_SCHEMA
W3C XML Schema.
|
| Modifier and Type | Method and Description |
|---|---|
static javax.xml.parsers.DocumentBuilder |
buildSecureDocumentBuilder()
Constructs a new document builder with security features enabled.
|
static javax.xml.parsers.SAXParser |
buildSecureSaxParser()
Constructs a secure SAX Parser.
|
static javax.xml.parsers.SAXParser |
buildSecureSaxParser(java.io.InputStream... schemaStream)
Constructs a validating secure SAX Parser.
|
static java.lang.String |
getPrettyParseExceptionInfo(org.xml.sax.SAXParseException ex)
Builds a prettier exception message.
|
static boolean |
parseBoolean(java.lang.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 java.lang.String JAXP_SCHEMA_LANGUAGE
public static final java.lang.String W3C_XML_SCHEMA
public static final java.lang.String JAXP_SCHEMA_SOURCE
public static javax.xml.parsers.SAXParser buildSecureSaxParser(java.io.InputStream... schemaStream)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException,
org.xml.sax.SAXException
schemaStream - One or more inputStreams with the schema(s) that the
parser should be able to validate the XML against, one InputStream per
schemajavax.xml.parsers.ParserConfigurationException - is thrown if there
is a parser configuration exceptionorg.xml.sax.SAXNotRecognizedException - thrown if there is an
unrecognized featureorg.xml.sax.SAXNotSupportedException - thrown if there is a
non-supported featureorg.xml.sax.SAXException - is thrown if there is a
org.xml.sax.SAXExceptionpublic static boolean parseBoolean(java.lang.String lexicalXSDBoolean)
lexicalXSDBoolean - The string-value of the booleanlexicalXSDBooleanjava.lang.IllegalArgumentException - When lexicalXSDBoolean
does fit the lexical space of the XSD boolean datatypepublic static javax.xml.parsers.SAXParser buildSecureSaxParser()
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException,
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException - thrown if there is
a parser configuration exceptionorg.xml.sax.SAXNotRecognizedException - thrown if there is an
unrecognized featureorg.xml.sax.SAXNotSupportedException - thrown if there is a
non-supported featureorg.xml.sax.SAXException - is thrown if there is a
org.xml.sax.SAXExceptionpublic static javax.xml.parsers.DocumentBuilder buildSecureDocumentBuilder()
throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException - thrown if there is
a parser configuration exceptionpublic static java.lang.String getPrettyParseExceptionInfo(org.xml.sax.SAXParseException ex)
ex - the SAXParseExceptionCopyright© 2012-21 Jeremy Long. All Rights Reserved.