From bae0987a29a984e64ea2c9c128c52798aaf41a5c Mon Sep 17 00:00:00 2001 From: Gerald Schmidt Date: Tue, 18 Dec 2007 21:40:17 +0000 Subject: [PATCH] Patched to fix XML catalog access for DTD validation and prevent excessive memory usage at validation time. --- src/xmlcopyeditor.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index 3359cb9..c12a3cb 100755 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -3773,13 +3773,17 @@ void MyFrame::OnValidateSchema ( wxCommandEvent& event ) // branch: if no XML Schema found, use LibXML DTD parser instead // so the catalog is read - switch when Xerces-C implements // XMLCatalogResolver - std::string rawBuffer, schemaLocation; - getRawText ( doc, rawBuffer ); - auto_ptr xsl (new XmlSchemaLocator() ); - xsl->parse ( rawBuffer.c_str() ); - if ( ( xsl->getSchemaLocation() ) . empty() ) - OnValidateDTD ( event ); - // end of branch + { + std::string rawBuffer, schemaLocation; + getRawText ( doc, rawBuffer ); + auto_ptr xsl (new XmlSchemaLocator() ); + xsl->parse ( rawBuffer.c_str() ); + if ( ( xsl->getSchemaLocation() ) . empty() ) + { + OnValidateDTD ( event ); + return; + } + } wxString fileName; std::string tempFileNameLocal;