xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jayne_Peac...@jba.co.uk
Subject Required - example java code to demonstrate error reporting
Date Thu, 06 Apr 2000 15:24:46 GMT
Now that XML Schemas are replacing DTD's I've started use
the Xerces Java Parser 1.0.3 but in my java class, when I parse my XML
document (which has a schema associated in it),
only syntactic errors are detected  by a SAXException being thrown - such
as a tag without an end tag - these can be detected in both the XML Schema
and the base XML,
but I am unable to detect other errors such as an element that has
minOccurs='2', but it is only occurs once.

I have tried looking for examples and but none of them appear to go into
enough detail. The only information I can get is to
use  the DOMParser  setFeature( "http://xml.org/sax/features/validation",
true) method, but this gives that problem described

When I used DTD's I used to check that whether the XML document had been
validated by using
the Parser methods getNumberOfErrors() or getNumberOfWarnings().
Has anyone go an example of some java code doing the equivalent type of
thing with schemas.

Thank you

View raw message