org.apache.commons.digester.parser
public class XercesParser extends java.lang.Object
SAXParser
based on the underlying Xerces version.
Currently, Xerces 2.3 and up doesn't implement schema validation the same way
2.1 was. In other to support schema validation in a portable way between
parser, some features/properties need to be set.Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
JAXP_SCHEMA_LANGUAGE
The JAXP 1.2 property to set up the schemaLanguage used.
|
private static java.lang.String |
JAXP_SCHEMA_SOURCE
The JAXP 1.2 property required to set up the schema location.
|
protected static org.apache.commons.logging.Log |
log
The Log to which all SAX event related logging calls will be made.
|
protected static float |
version
A
float representing the underlying Xerces version |
protected static java.lang.String |
versionNumber
The current Xerces version.
|
protected static java.lang.String |
XERCES_DYNAMIC
Xerces dynamic validation property
|
protected static java.lang.String |
XERCES_SCHEMA
Xerces schema validation property
|
Constructor and Description |
---|
XercesParser() |
Modifier and Type | Method and Description |
---|---|
private static void |
configureOldXerces(javax.xml.parsers.SAXParser parser,
java.util.Properties properties)
Configure schema validation as recommended by the JAXP 1.2 spec.
|
private static void |
configureXerces(javax.xml.parsers.SAXParserFactory factory)
Configure schema validation as recommended by the Xerces spec.
|
private static java.lang.String |
getXercesVersion()
Return the current Xerces version.
|
static javax.xml.parsers.SAXParser |
newSAXParser(java.util.Properties properties)
Create a
SAXParser based on the underlying
Xerces version. |
protected static org.apache.commons.logging.Log log
private static final java.lang.String JAXP_SCHEMA_SOURCE
protected static java.lang.String JAXP_SCHEMA_LANGUAGE
protected static java.lang.String XERCES_DYNAMIC
protected static java.lang.String XERCES_SCHEMA
protected static float version
float
representing the underlying Xerces versionprotected static java.lang.String versionNumber
private static java.lang.String getXercesVersion()
public static javax.xml.parsers.SAXParser newSAXParser(java.util.Properties properties) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, org.xml.sax.SAXNotSupportedException
SAXParser
based on the underlying
Xerces
version.properties
- parser specific properties/featuresSAXParser
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
org.xml.sax.SAXNotSupportedException
private static void configureOldXerces(javax.xml.parsers.SAXParser parser, java.util.Properties properties) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXNotSupportedException
properties
object may contains information about
the schema local and language.properties
- parser optional infojavax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXNotSupportedException
private static void configureXerces(javax.xml.parsers.SAXParserFactory factory) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
NOTE: This method is broken. It is supposed to set up validation against the schema specified in property "schemaLocation", but it doesn't.
factory
- SAXParserFactory to be configuredjavax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
Copyright 2001-2005 The Apache Software Foundation.