views:

256

answers:

2

Which Java XML libraries can do SAX-based parsing and validation against an XML Schema (XSD) at the same time?

I'm really looking for the most efficient solution for reading and validating large XML files.

bonus points if you can provide sample code.

+2  A: 

Xerces which is part of the Sun JDK can do validation. You can see in the docs.

Robert Klemme
+2  A: 

As suggested by Robert , Xerces provides SAX-based parsing and XSD validation.

You can checkout example at :

http://www.herongyang.com/XML-Schema/Xerces2-XSD-Validation-with-SAXParser.html

YoK