Stephen Collyer wrote:
Jane Jin (janej) wrote:

Hello All,
I'm trying to do schema validation on an xml file. I set the following
features:
parser->setFeature(XMLUni::fgDOMNamespaces, true);
                    parser->setFeature(XMLUni::fgXercesSchema, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true);
                    schema_file = XMLString::transcode("message.xsd");


I've only used the Perl bindings to Xerces, but to turn on validation
I have successfully used the following feature, rather than
SchemaFullChecking:

parser->setFeature(XML::Xerces::XMLUni::fgSAX2CoreValidation, true);

(translated from Perl to C++ so check syntax before using)



Here's what I've got and it seems to work for me:

=======================================================================================
parser->setFeature(XMLUni::fgXercesSchema, true);
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true);
parser->setProperty(XMLUni::fgXercesSchemaExternalSchemaLocation,
        schema_location);
=======================================================================================

Reply via email to