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 Umesh Chandak <um...@gs-lab.com> on 2007/02/05 09:07:31 UTC
load grammar fails to load the
http://schemas.xmlsoap.org/soap/encoding/
Hi All,
I am trying to import the namespace
http://schemas.xmlsoap.org/soap/encoding/ in my schema. But Xerces
loadGrammar function fails to load this schema. It gives me error
Error: /home/umeshc/Desktop/encoding.xml (Line 151: Column 52)
It is an error for NOTATION to be used directly in a schema in
element/attribute 'NOTATION'.
Following is my code snippet ...
const bool schemaFullChecking = true;
SAX2XMLReaderImpl* parser = new
SAX2XMLReaderImpl(XMLPlatformUtils::fgMemoryManager, grammarPool);
Janitor<SAX2XMLReaderImpl> janParser(parser);
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
parser->setFeature(XMLUni::fgXercesSchema, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking,
schemaFullChecking);
parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, false);
parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
parser->setFeature(XMLUni::fgXercesDynamic, true);
XMLEntityResolver * currentEntityResolver =
parser->getXMLEntityResolver();
XMLImportIncludeResolverWrapper* r = new
XMLImportIncludeResolverWrapper(currentEntityResolver,
entityResolver,entityResolverArg, errors) ;
parser->setXMLEntityResolver(r);
XSDErrorHandler* errorHandler = new XSDErrorHandler(); // new
XSDErrorHandler(&cout);
Janitor<XSDErrorHandler> janErrorHandler(errorHandler);
parser->setErrorHandler(errorHandler);
Grammar* result = parser->loadGrammar(xsdFileName[0],
Grammar::SchemaGrammarType, true);
delete r;
if (errorHandler->hasErrors()) {
printf("Error Handler flushed : %s
\n",errorHandler->str().c_str());
return false;
}
if (result==NULL) {
return false;
}
return true;
Above namespace is standard namespace. There is an error on line 151 of
that namespace.
Can any body tell we why this is happening. Does I need to different
setting than this for loadGrammar? Does I need to enable some feature
for this. Any help is appreciated.
Thanks in advance.
Regards,
Umesh
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org