[
https://issues.apache.org/jira/browse/XERCESC-1933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alain BOHL updated XERCESC-1933:
--------------------------------
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;
errorHandler.setLogFile(pFicLog);
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
***********************************
was:
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;
errorHandler.setLogFile(pFicLog);
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
***********************************
Just to complete my sample code and to tell that I have found other xml files
that happily don't make my short program crash.
There should be something that xerces doesn't like in my xml file.
But my xml file is valid for the xsd file.
It has been verified with XML Node Pad.
> After parsing an XML with PVI information kept, the DOMLSParser object
> crashes when released...
> -----------------------------------------------------------------------------------------------
>
> Key: XERCESC-1933
> URL: https://issues.apache.org/jira/browse/XERCESC-1933
> Project: Xerces-C++
> Issue Type: Bug
> Components: DOM, Validating Parser (XML Schema)
> Affects Versions: 3.1.1
> Environment: Windows XP SP3, Visual Studio 8 (2005), also XQuilla
> 2.2.4 (but not necessary to get the crash)
> Reporter: Alain BOHL
> Attachments: file.xml, file.xsd
>
>
> 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;
> errorHandler.setLogFile(pFicLog);
> 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
> ***********************************
--
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: [email protected]
For additional commands, e-mail: [email protected]