• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java XML Validation Framework Alternative to Xerces

 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 https://coderanch.com/how-to/java/HowToValidateXmlAgainstAnySchema for how to use JAXP for validation.

What is the reason for wanting to avoid Xerces?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Crimson supports validation via DTD and (supposedly) a subset of XML Schema.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is list of Open Source XML Parsers in Java

http://java-source.net/open-source/xml-parsers
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic