cvc-elt.1: Cannot find the declaration of element 'abcd:abc'
Kunal Chauhan <[email protected]> Tue, 9 Aug 2011 09:06:44 +0000 (UTC)
| Newsgroups | gmane.text.xml.sax.general |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I am trying to validate my .XML file with XSD.
But getting following error.
cvc-elt.1: Cannot find the declaration of element 'abcd:abc'.
Below is my code.
String schemaLang = "http://www.w3.org/2001/XMLSchema";
SchemaFactory jaxp =
SchemaFactory.newInstanceXMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = jaxp.newSchema(new StreamSource("<Path>.xsd"));
Validator validator = schema.newValidator();
DefaultHandler handler = new DefaultHandler();
SAXResult sax = new SAXResult(handler);
SAXSource source = new SAXSource(new InputSource("<Path>.xml"));
validator.validate(source, sax);
please guide me if anything missing ?
Thanks & Regards,
Kunal Chauhan
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
List: [email protected]
See: http://www.saxproject.org
https://lists.sourceforge.net/lists/listinfo/sax-users