How do I find out which Xerces version I am using?
To find out the release version of Xerces, execute the following:
java org.apache.xerces.impl.Version.
How do I use JIRA to report bugs?
Please refer to the Reporting bugs in JIRA.
What happened to xerces.jar?
In order to take advantage of the fact that this parser is very often used in conjunction with other XML technologies, such as XSLT processors, which also rely on standard API's like DOM and SAX, xerces.jar was split into two jarfiles:
xml-apis.jar contains the DOM level 3,
SAX 2.0.2 and the JAXP 1.4 APIs;xercesImpl.jar contains the implementation of
these API's as well as the XNI API.
For backwards compatibility, we have retained the ability to generate xerces.jar. For instructions, see the installation documentation.
How can I use JAXP 1.4 on JDK 1.4 and above?
Use the
The following methods do not work:
Why do I get a ClassCastException when I use Xerces and WebSphere Application Server?
Xerces uses the ObjectFactory class to load some classes dynamically, e.g. the parser configuration.
The ObjectFactory finds the specified implementation class by querying the system property, reading
META-INF/services/factoryId file or using a fallback classname. After the implementation is found, the
ObjectFactory tries to load the file using the context classloader and if it is null, the
ObjectFactory uses the system classloader.
If you run Xerces in an environment, such as WebSphere® Application Server, that has multiple classloaders you may get ClassCastExceptions thrown from Xerces because different classloaders might get involved in loading Xerces classes. For example, ClassCastExceptions may occur when utility EAR classes that use Xerces load Xerces classes from WAR modules.
We suggest you read the
What should I be using instead of Xerces' XML, HTML or XHTML serializers?
As of the 2.9.0 release Xerces-J began sharing a common serialization codebase with Xalan and now includes serializer.jar
with its distribution for DOM Level 3 serialization support. The entire org.apache.xml.serialize package was
deprecated in Xerces 2.9.0. The HTML and XHTML serializers were previously deprecated in the
Xerces 2.6.2 release. You can find more details about the rationale for this decision here in the
If you want to achieve interoperability and avoid using deprecated APIs, you should not be using Xerces serialization code directly.
Instead, the
Using
Using
I don't need all the features Xerces provides, but I'm running in an environment where space is at a premium. Is there anything I can do?
Partially to address this issue, we've recently begun to
distribute compressed jar files instead of our traditionally
uncompressed files. But if you still need a smaller jar, and
don't need things like support for XML Schema or the WML/HTML
DOM implementations that Xerces provides, then look at the
dtdjars target in our
buildfile.
How do I turn on DTD validation?
You can turn validation on and off via methods available
on the SAX2 XMLReader interface. While only the
SAXParser implements the XMLReader
interface, the methods required for turning on validation
are available to both parser classes, DOM and SAX.
The code snippet below shows how to turn validation on -- assume
that parser is an instance of either
org.apache.xerces.parsers.SAXParser or
org.apache.xerces.parsers.DOMParser.
parser.setFeature("http://xml.org/sax/features/validation", true);
What international encodings are supported by &ParserName;?
Why is the parser unable to access schema documents or external entities available on the Internet?
The parser may not be able to access various external entities or schema documents
(imported, included etc...) available on the Internet, such as the Schema for Schemas
"http://www.w3.org/2001/XMLSchema.xsd" or the schema defining xml:base, xml:lang attributes etc...
"http://www.w3.org/2001/xml.xsd" or any other external entity available on the Internet. There
are various reasons one could experience such a problem.
One of the reasons could be that your proxy settings do not allow the parser to make
URL connections through a proxy server. To solve this problem, before parsing a document,
the application must set the two system properties: "http.proxyHost" and "http.proxyPort".
Another reason could be due to strict firewall settings that do not allow any URL connection
to be made to the outside web. The problem may also be caused by a server that is offline or
inaccessible on the network, preventing documents hosted by the server from being accessed.
What JDK level is required for Xerces?
As of version 2.10.0, Xerces requires JDK 1.3 or later to run and also requires JDK 1.3 or later to build the source code.