Java XML Validation Framework Alternative to Xerces
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2193
posted
0
Hi!
What alternatives are there to Apache Xerces, concerning XML validation from inside a Java application?
As far as I understand, Xerces is incorporated in the XML validation offered by the Java SE API (correct me if I am wrong).
I am looking for something that is not related to, or use, Xerces in any way.
Thanks in advance!
You don't need to use Xerces, specifically. JAXP can be configured to use whichever parser you prefer, although I don't think there are many other validating parsers left by now.
Ulf Dittmer wrote:
What is the reason for wanting to avoid Xerces?
A supposed bug in Xerces. I would want to give another validating framework a try to see if this is indeed the problem or if there is some other reason.
Best wishes!
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
Crimson supports validation via DTD and (supposedly) a subset of XML Schema.
Jimmy Clark
Ranch Hand
Joined: Apr 16, 2008
Posts: 2187
posted
0
Xerces is an XML parser, it is not a framework.
A version of Xerces was included in the Java SE. However, this version is not exactly the same as the Apache version. There are some differences in regards to performance.
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2193
posted
0
Hi!
Thanks for the replies - now I know how to tell a parser from a framework! :-)
It turned out that there was no bug in Apache Xerces - at least not that cause the problem I was set to solve.
The problem was deep hierarchies of XML schemas. In order for Xerces to traverse the entire hierarchies, a property telling Xerces to honour all XML schema locations had to be set (http://apache.org/xml/features/honour-all-schemaLocations).
There were some other issues as well, but the main issue was the honour-all-schema-locations.
Reference: http://xerces.apache.org/xerces2-j/features.html Best wishes!