Hi, I have spent past 2 hours on this. Am unable to figure out why this error is occurring. I have a simple xsd and xml code

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<element name="root_element" type="string"/>
</schema>



<?xml version="1.0" encoding="UTF-8"?>
<root_element>"asd"</root_element>



My java code is:

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
SchemaFactory s_factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCH EMA_NS_URI);
dbf.setSchema(s_factory.newSchema(new File(schemafile)));
dbf.setValidating(true);
dbf.setFeature("http://apache.org/xml/features/validation/schema", true);
DocumentBuilder db = dbf.newDocumentBuilder();
CommodityPropsErrorHandler cp_eh = new CommodityPropsErrorHandler();
db.setErrorHandler(cp_eh);
Document doc = db.parse(new File(props_file));

Any comments would be helpful. regards