Hi,
I am using a MemBufInputSource instance as my input to the xerces parser. I use the 
following code to set the validation on, and specify the external schema location:

        SAXParser parser;

        parser.setValidationScheme(SAXParser::Val_Always);
        parser.setExternalNoNamespaceSchemaLocation("xmlloader.xsd");
        parser.setValidationConstraintFatal(true);
        parser.setDoSchema(true);
        parser.setValidationSchemaFullChecking(true);

The xml input to the parser does not contain the specification of the schema. The 
parser throws up an error while processing the schema itself, towards the end of the 
schema file (almost the last line) "Expected comment or Processing Instruction."

However, if I modify the xml input to add the following attributes in the root:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:noNamespaceSchemaLocation="xmlloader.xsd"

and comment out the call to setExternalNoNamespaceSchemaLocation(), In this case, the 
parser successfully validates (using the schema) and parses the input. 

Could you tell me why this is happening, or what I need to do to make it work without 
having the schema name specified in the xml input.

Thanks in advance,
Urmi


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

Reply via email to