[Greater-commits] r8 - trunk/Administration
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jun 8 12:14:57 CEST 2011
Author: aheinecke
Date: 2011-06-08 12:14:54 +0200 (Wed, 08 Jun 2011)
New Revision: 8
Modified:
trunk/Administration/ExportDialog.cpp
trunk/Administration/ExportDialog.h
trunk/Administration/ImportDialog.cpp
trunk/Administration/ImportDialog.h
Log:
Backport Export/Import Dialog again to xerces2.8 from xerces3.0
Modified: trunk/Administration/ExportDialog.cpp
===================================================================
--- trunk/Administration/ExportDialog.cpp 2011-06-07 16:21:26 UTC (rev 7)
+++ trunk/Administration/ExportDialog.cpp 2011-06-08 10:14:54 UTC (rev 8)
@@ -958,7 +958,6 @@
const char* p_d_const;
const char* p_f_const;
XMLFormatTarget* myFormTarget;
- DOMLSOutput* myDomOutput;
int retval = DA_FAIL;
//Initialize the XML4C2 system.
@@ -999,8 +998,8 @@
doctype); //document type object (DTD).
//Set XML encoding
-// strcpy(p_encode, "iso-8859-1");
-// doc->setEncoding(XMLConv(p_encode));
+ strcpy(p_encode, "iso-8859-1");
+ doc->setEncoding(XMLConv(p_encode));
//Write Catchment data, if existing and checkbox is checked
if (checkCatchment->IsChecked() && (p_catch != NULL))
@@ -1076,28 +1075,23 @@
//
*/
strcpy(p_newline, "\n");
- DOMLSSerializer* theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+ DOMWriter* theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
theSerializer->setNewLine(XMLConv(p_newline));
- DOMConfiguration* dc = theSerializer->getDomConfig();
+ theSerializer->setEncoding(XMLConv(p_encode));
+ theSerializer->setFeature(XMLConv("format-pretty-print"), TRUE);
- dc->setParameter(XMLString::transcode("format-pretty-print"), true);
-
//Get path + name for XML file from input dialog
filepath = textFilePath->GetValue();
p_f_const = filepath.c_str();
strcpy(p_XML_file, p_f_const);
- try
+ try
{
- myDomOutput = ((DOMImplementationLS*)impl)->createLSOutput();
- myDomOutput->setEncoding(XMLConv(p_encode));
//Print the XML stream to file
myFormTarget = new LocalFileFormatTarget(XMLConv(p_XML_file));
- myDomOutput->setByteStream(myFormTarget);
-
//do the serialization through DOMWriter::writeNode();
- theSerializer->write(doc, myDomOutput);
+ theSerializer->writeNode(myFormTarget, *doc);
}
catch (const XMLException& toCatch)
{
@@ -1140,8 +1134,6 @@
delete myFormTarget;
doc->release();
- myDomOutput->release();
- delete myDomOutput;
XMLPlatformUtils::Terminate();
Modified: trunk/Administration/ExportDialog.h
===================================================================
--- trunk/Administration/ExportDialog.h 2011-06-07 16:21:26 UTC (rev 7)
+++ trunk/Administration/ExportDialog.h 2011-06-08 10:14:54 UTC (rev 8)
@@ -53,7 +53,7 @@
#include "MainWindow.h"
#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
-#include <xercesc/dom/DOMLSSerializer.hpp>
+#include <xercesc/dom/DOMWriter.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/parsers/AbstractDOMParser.hpp>
#include <xercesc/sax/HandlerBase.hpp>
Modified: trunk/Administration/ImportDialog.cpp
===================================================================
--- trunk/Administration/ImportDialog.cpp 2011-06-07 16:21:26 UTC (rev 7)
+++ trunk/Administration/ImportDialog.cpp 2011-06-08 10:14:54 UTC (rev 8)
@@ -384,7 +384,7 @@
*/
XercesDOMParser *parser = new XercesDOMParser();
parser->setValidationScheme(XercesDOMParser::Val_Always);
-// parser->setDoValidation(TRUE);
+ parser->setDoValidation(TRUE);
parser->setDoNamespaces(TRUE);
parser->setDoSchema(TRUE);
Modified: trunk/Administration/ImportDialog.h
===================================================================
--- trunk/Administration/ImportDialog.h 2011-06-07 16:21:26 UTC (rev 7)
+++ trunk/Administration/ImportDialog.h 2011-06-08 10:14:54 UTC (rev 8)
@@ -53,7 +53,7 @@
#include "MainWindow.h"
#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
-#include <xercesc/dom/DOMLSSerializer.hpp>
+#include <xercesc/dom/DOMWriter.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/parsers/AbstractDOMParser.hpp>
#include <xercesc/sax/HandlerBase.hpp>
More information about the Greater-commits
mailing list