Which version of xerces-j are you using?.

If you are using xerces-j-1.4.0 then you should use 
"http://www.w3.org/2001/XMLSchema"; instead of 
"http://www.w3.org/2000/10/XMLSchema";.

This type of problem viz. "Element not declared" usually occurs because of using 
incorrect namespace.

Rahul.

> Subject: Schema Validation Problem
> To: [EMAIL PROTECTED]
> From: [EMAIL PROTECTED]
> Date: Sat, 23 Jun 2001 18:28:25 +0530
> 
> Hello
> 
> I am facing a problem. I am trying to validate a xml file against a schema
> xsd file.
> 
> code is some thing like this -
> 
> >>>>
> 
> SAXParser parser = new SAXParser();
> 
>  parser.setErrorHandler (this);
> 
>  parser.setFeature("http://xml.org/sax/features/validation",true);
> 
> parser.setFeature ("http://apache.org/xml/features/validation/schema";,
> true);
> 
> parser.parse(xmlFile);
> 
> <<<<<
> 
> Error handler is defined in the same program.
> 
> When  i am running this program, it is thorwing error like -
> 
> >>>
> 
> Error:  org.xml.sax.SAXParseException: Element type "attribute" must be
> declared.
> 
> Error:  org.xml.sax.SAXParseException: Attribute "name" must be declared
> for element type "attribute".
> 
> <<<
> 
> And this type of error message is comming for every elemets and attributes
> in xml file.
> 
> Can someone tell me the problem area.
> 
> Thanks in advance for any help
> 
> 
> Brajendra Singh
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 





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

Reply via email to