posted 19 years ago
Create a StrignReader out of the XML in the String
Reader is=new StringReader(xmlString)
parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schemaFileLocation);
parser.setFeature( "http://apache.org/xml/features/validation/schema",true);
parser.setFeature("http://apache.org/xml/features/validation/schema",false);
parser.setContentHandler(yourContentHandler);
parser.setErrorHandler(yourErrorHandler);
parser.setFeature( "http://xml.org/sax/features/validation",VALIDATION);
parser.setFeature( "http://xml.org/sax/features/namespaces",true);
parser.setFeature("http://apache.org/xml/features/validation/schema",true);
parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking",true);
parser.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false);
parser.setFeature("http://apache.org/xml/features/validation/dynamic", false);
parser.parse(new InputSource(is));
SCJP2<br />BEA Certified J2EE Developer