You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Chatterjee, Urmi" <UR...@ca.com> on 2002/05/10 20:23:46 UTC

Need help with external schema processing

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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org