Hi all,
first, I' like to thank the developers for their effort. We use Xerces-C
a lot and are quite happy with it!
Recently we encountered a problem with the evaluation speed of identity
constraints (xs:key, xs:keyref, xpath) in Xerces-C 3.0.0.
At http://www-bs2.informatik.uni-tuebingen.de/services/sturm/public/ you
can find an XML example file and two schema versions.
Validating the example without identity constraints takes about 30
seconds. With identity constraints it takes like an hour.
Is this a known problem, or do we do something wrong? I attached the
code used to perform the validation.
Thanks in advance,
Marc
---------------------------------------------------------------------------------
//initialize
try
{
XMLPlatformUtils::Initialize();
}
catch (const XMLException& toCatch)
{
//...
}
SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
parser->setFeature(XMLUni::fgXercesDynamic, false);
parser->setFeature(XMLUni::fgXercesSchema, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true);
//set this class as error handler
parser->setErrorHandler(this);
parser->setContentHandler(NULL);
parser->setEntityResolver(NULL);
//load schema
LocalFileInputSource schema_file(schema);
parser->loadGrammar(schema_file, Grammar::SchemaGrammarType, true);
parser->setFeature(XMLUni::fgXercesUseCachedGrammarInParse, true);
// try to validate the file
LocalFileInputSource source(filename);
try
{
parser->parse(source);
delete(parser);
}
catch (...)
{
///...
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]