Schema and DTD Validation

wxdqz

New Member
-> How to validate an XML file against a schema. The way I have tried doingthis using apache's xml parser is as follows, as specified in the documentationalso...........parser.setFeature("http://apache.org/xml/features/validation/schema", true);// parser.setFeature( "http://xml.org/sax/features/namespaces",true);// parser.setFeature( "http://xml.org/sax/features/validation",true);parser.setErrorHandler (this);parser.parse(new InputSource(xmlStream));Document document = parser.getDocument();............I have an XML data file which I fist parsed and validated using a dtd, thatworks just fine. But when I created a Schema and tried to do the same aftermaking the required changes in the Data file its not actually doing the validation.Its not throwing errrors but its not trapping any inconsistencies also.Where am i going wrong??->If the vaiables/options I have to set for doing this are correct then theydont seem to be global, but sort of apache specific.Are the standard variable defined for this kind of an operation or this processitself is apache parser specific.TxAbhishek
 
Back
Top