SAX Parser and XML Schema (XSD) validation

若如初见. 提交于 2019-12-06 13:31:16

问题


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.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/2417512/sax-parser-and-xml-schema-xsd-validation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!