how to use xerces in java?

HeXo

New Member
This is my code for validation of xml only problem i am having is in line 2 while importing org.apache.xerces...i downloaded xerces.jar and then added it as external jar into class from run configuration,can you just tell me if i am doing it write if yes then why this error if no then what should i do.\[code\]import java.io.File;import org.apache.xerces.parsers.DOMParser;public class SchemaTest { public static void main (String[] args) { File docFile = new File("C:\\Users\\ahussain\\Desktop\\Xml_Validation\\memory.xml"); try { DOMParser parser = new DOMParser(); parser.setFeature("http://xml.org/sax/features/validation", true); parser.setProperty("http://apache.org/xml/properties/schema/external- noNamespaceSchemaLocation","memory.xsd"); ErrorChecker errors = new ErrorChecker(); parser.setErrorHandler(errors); parser.parse("memory.xml"); } catch (Exception e) { System.out.print("Problem parsing the file."); } }}\[/code\]
 
Back
Top