aspose file tools*
The moose likes XML and Related Technologies and the fly likes Java XML Validation Framework Alternative to Xerces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Java XML Validation Framework Alternative to Xerces" Watch "Java XML Validation Framework Alternative to Xerces" New topic
Author

Java XML Validation Framework Alternative to Xerces

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!


My free books and tutorials: http://www.slideshare.net/krizsan
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
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.

See http://www.coderanch.com/how-to/java/HowToValidateXmlAgainstAnySchema for how to use JAXP for validation.

What is the reason for wanting to avoid Xerces?

Ping & DNS - my free Android networking tools app
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Thanks!
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: 42648
    
  65
Crimson supports validation via DTD and (supposedly) a subset of XML Schema.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
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
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!
Suresh K Babu
Greenhorn

Joined: Feb 10, 2007
Posts: 16
Here is list of Open Source XML Parsers in Java

http://java-source.net/open-source/xml-parsers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java XML Validation Framework Alternative to Xerces