Hi there!

Can any one let me know how to read mutiple XSD to validate XML file ? I am
having multiple XSD which are interlink to each other. I even tried to kept
in the WEB-INF/class path but it didn't work..

Code Sample:

ContentHandler appContentHandler = // get app handler.;
SchemaFactory factory =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = factory.newSchema(getClass().getResource("abcd.xsd"));
ValidatorHandler validationHandler = schema.newValidatorHandler();
validationHandler.setContentHandler(appContentHandler);
try {
        SAXParserFactory parserFactory = SAXParserFactory.newInstance();
        parserFactory.setNamespaceAware(true);
        XMLReader reader = parserFactory.newSAXParser().getXMLReader();
        reader.setContentHandler(validationHandler);
        reader.parse(getClass().getResource("test.xml"));
}
catch(SAXException e) {
        // By default, SAX Exceptions are thrown to show that the document 
didn't 
        // validate.
}

I have to deploy the application on Weblogic 8.1 service pack.

Would appreciate your prompt response!

With Thanks!
Newkid
-- 
View this message in context: 
http://www.nabble.com/Need-Immediate-help...-Unable-to-link-multiple-XSD-tp16649718p16649718.html
Sent from the Xerces - J - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to