I am trying to build a SAX2 parser to validate using an external schema.
I have been able to do that with a SAX parser and
setExternalSchemaLocation just fine
but when I try doing the same under SAX2 I am receiving the following
exception.
" Message: The schemaLocation attribute does not contain pairs of
values."
I have looked over the documentation pretty good and I think I am
setting all of
the correct properties and features to accomplish what I am trying to do
but apparently I am missing something here.
here is a code sample of the setup I am using:
SAX2XMLReader* parser;
parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
parser->setFeature(XMLUni::fgXercesDynamic, false);
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
parser->setFeature(XMLUni::fgXercesSchema, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true);
parser->setProperty(XMLUni::fgXercesSchemaExternalSchemaLocation,
"http://schemas.xmlsoap.org/soap/envelope/ envelope.xsd");
----------------------
parser->getProperty(XMLUni::fgXercesSchemaExternalSchemaLocation)
returns the "http://schemas.xmlsoap.org/soap/envelope/ envelope.xsd"
string so it looks as though the property is being set.
Everything will parse just fine if I do not attempt to validate the XML.
The schemas and XML documents I am working with work ok with the SAX1
parser so I do not think I there are issues with the input data.
Thanks
Randy