You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Thamm, Russell" <ru...@dsto.defence.gov.au> on 2004/04/15 06:55:48 UTC
Identity Constraint Validation
Hi,
can anyone tell me the secret of getting Xerces-J to perform full schema validation,
in particular to check Identity Constraints.
This is my code (hand copied so may have typos)
DOMParser parser = new DOMParser();
try
{
Errors errors = new Errors();
parser.setFeature("http://apache.org/xml/features/defer-node-expansion",false);
parser.setFeature("http://apache.org/xml/features/validation/schema",true);
parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",true);
parser.setErrorHandler(errors);
parser.parse("c:\\chk.xml");
}
catch (Exception ex)
{
ex.printStackTrace();
}
Even though my source file contains Identity Constraint errors, I get none reported.
If I load this file into jEdit (with XML plugin), the Identity Constraint errors are reported. Strangely the jEdit
XML plugin uses the same version of Xerces-J that I do (2.6.0). However jEdit uses the SAX parser.
thanks
Russell Thamm
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org