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 "Boris Kolpackov (JIRA)" <xe...@xml.apache.org> on 2009/07/19 00:34:14 UTC

[jira] Updated: (XERCESC-1878) Validation of xs:keys and xs:keyrefs with xpath takes too long

     [ https://issues.apache.org/jira/browse/XERCESC-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Kolpackov updated XERCESC-1878:
-------------------------------------

    Fix Version/s: 3.1.0

> Validation of xs:keys and xs:keyrefs with xpath takes too long
> --------------------------------------------------------------
>
>                 Key: XERCESC-1878
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1878
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (XML Schema)
>    Affects Versions: 3.0.1
>         Environment: Scientific Linux 5.2, x86_64, GCC 4.4.0
>            Reporter: Marc Sturm
>             Fix For: 3.1.0
>
>
> When an mzML XML file against its schema, the validation of the xs:keys and xs:keyrefs using xpath takes 40 to 60 minutes. Validation without keys only takes about 30 seconds.
> The following files can be used to reproduce the problem:
> http://www-bs2.informatik.uni-tuebingen.de/services/sturm/public/example.mzML (XML instance document)
> http://www-bs2.informatik.uni-tuebingen.de/services/sturm/public/mzML110.xsd (slow validation schema)
> http://www-bs2.informatik.uni-tuebingen.de/services/sturm/public/mzML110_without_constraints.xsd (fast validation schema)
> I confirmed the behavior in version 3.0.0, 3.0.1 and Trunk revision 794181.
> This is the C++ code used for the validation is:
> //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 (...)
> {
>    ///...
> } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org