I want to parse a xml file using a SAXParser or XMLReader and verify that the file conforms to a specific xsd file (new File( "example.xsd" )
).
It's easy to
do the validation against a xsd file in an extra step using a
Validator
like in this SO answer.to validate while parsing by specifying the name of the xsd as
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"
like in this SO answer.
But how can I validate against a new File( "example.xsd" )
while parsing?