Patched to fix XML catalog access for DTD validation and prevent excessive memory usage at validation time.

This commit is contained in:
Gerald Schmidt 2007-12-18 21:40:17 +00:00
parent 100432dc9e
commit bae0987a29
1 changed files with 11 additions and 7 deletions

View File

@ -3773,13 +3773,17 @@ void MyFrame::OnValidateSchema ( wxCommandEvent& event )
// branch: if no XML Schema found, use LibXML DTD parser instead // branch: if no XML Schema found, use LibXML DTD parser instead
// so the catalog is read - switch when Xerces-C implements // so the catalog is read - switch when Xerces-C implements
// XMLCatalogResolver // XMLCatalogResolver
std::string rawBuffer, schemaLocation; {
getRawText ( doc, rawBuffer ); std::string rawBuffer, schemaLocation;
auto_ptr<XmlSchemaLocator> xsl (new XmlSchemaLocator() ); getRawText ( doc, rawBuffer );
xsl->parse ( rawBuffer.c_str() ); auto_ptr<XmlSchemaLocator> xsl (new XmlSchemaLocator() );
if ( ( xsl->getSchemaLocation() ) . empty() ) xsl->parse ( rawBuffer.c_str() );
OnValidateDTD ( event ); if ( ( xsl->getSchemaLocation() ) . empty() )
// end of branch {
OnValidateDTD ( event );
return;
}
}
wxString fileName; wxString fileName;
std::string tempFileNameLocal; std::string tempFileNameLocal;