Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1933

After parsing an XML with PVI information kept, the DOMLSParser object crashes when released...

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 3.1.1
    • None
    • None
    • Windows XP SP3, Visual Studio 8 (2005), also XQuilla 2.2.4 (but not necessary to get the crash)

    Description

      XMLPlatformUtils::Initialize();
      DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(XMLString::transcode("Core"));
      m_parser = impl->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0);

      DOMConfiguration *config = m_parser->getDomConfig();

      config->setParameter(XMLUni::fgDOMNamespaces, true);
      config->setParameter(XMLUni::fgXercesSchema, true);
      config->setParameter(XMLUni::fgXercesHandleMultipleImports, true);
      config->setParameter(XMLUni::fgXercesSchemaFullChecking, true);
      config->setParameter(XMLUni::fgDOMComments, false);// Suppression des commentaires
      config->setParameter(XMLUni::fgDOMElementContentWhitespace, false);// Suppression des blancs

      config->setParameter(XMLUni::fgDOMValidateIfSchema, true); // config->setParameter(XMLUni::fgDOMValidate, true);

      // enable datatype normalization - default is off
      config->setParameter(XMLUni::fgDOMDatatypeNormalization, true);

      //************** If the following line is deleted the crash does not happen ****************
      config->setParameter(XMLUni::fgXercesDOMHasPSVIInfo, true);

      // Creation et installation of the error handler
      DOMReseauErrorHandler errorHandler;
      config->setParameter(XMLUni::fgDOMErrorHandler, &errorHandler);

      XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc = NULL;

      // reset document pool
      m_parser->resetDocumentPool();

      if (xsdFile.length() > 0)

      { Grammar* grammar; grammar = m_parser->loadGrammar(XMLString::transcode("file.xsd"), Grammar::SchemaGrammarType, true); //************************** grammar is not NULL }

      doc = m_parser->parseURI(XMLString::transcode("file.xml"));
      //***************************** No xml parser error were met

      delete m_parser; //*********************** Crash on this line ***********************************

      Attachments

        1. file.xml
          2 kB
          Alain BOHL
        2. file.xsd
          160 kB
          Alain BOHL
        3. XERCESC-1933.patch
          0.5 kB
          David N Bertoni
        4. XERCESC-1933v2.patch
          1 kB
          David N Bertoni

        Activity

          People

            dbertoni David N Bertoni
            abohl Alain BOHL
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: