SAX Parser and XML Schema (XSD) validation

2020-07-30 03:52发布

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条回答
姐就是有狂的资本
2楼-- · 2020-07-30 04:30

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

查看更多
啃猪蹄的小仙女
3楼-- · 2020-07-30 04:37

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

查看更多
登录 后发表回答