Salome HOME
Run tests on Windows platform.
[modules/geom.git] / src / XAO / XAO_XaoExporter.cxx
index bd34efafb2354a80167cba36ad47df041bd995b9..1871e3399d77e66451f237876902270a36fd97c0 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -310,14 +310,14 @@ namespace {
     parseXaoNode(doc, root, xaoObject);
 
     xmlFreeDoc(doc);       // free document
-    xmlCleanupParser();    // free globals
+    //xmlCleanupParser();    // free globals //vsr: xmlCleanupParser should not be called from the application
   }
 
   void parseXaoNode(xmlDocPtr doc, xmlNodePtr xaoNode, Xao* xaoObject)
   {
     std::string version = readStringProp(xaoNode, C_ATTR_XAO_VERSION, false, "");
     if (version != "")
-        xaoObject->setAuthor(version);
+        xaoObject->setVersion(version);
 
     std::string author = readStringProp(xaoNode, C_ATTR_XAO_AUTHOR, false, "");
     xaoObject->setAuthor(author);
@@ -592,7 +592,7 @@ namespace {
             int component = readIntegerProp(valNode, C_ATTR_VALUE_COMPONENT, true, -1);
             xmlChar* data = xmlNodeGetContent(valNode->children);
 
-            std::string value = (char*)data;
+            std::string value;
             if (data != NULL)
             {
                 value = (char*)data;
@@ -636,7 +636,7 @@ const bool XaoExporter::readFromFile(const std::string& fileName, Xao* xaoObject
 throw (XAO_Exception)
 {
     // parse the file and get the DOM
-    int options = XML_PARSE_HUGE || XML_PARSE_NOCDATA;
+    int options = XML_PARSE_HUGE | XML_PARSE_NOCDATA;
     xmlDocPtr doc = xmlReadFile(fileName.c_str(), NULL, options);
     if (doc == NULL)
     {
@@ -650,7 +650,7 @@ throw (XAO_Exception)
 const bool XaoExporter::setXML(const std::string& xml, Xao* xaoObject)
 throw (XAO_Exception)
 {
-    int options = XML_PARSE_HUGE || XML_PARSE_NOCDATA;
+    int options = XML_PARSE_HUGE | XML_PARSE_NOCDATA;
     xmlDocPtr doc = xmlReadDoc(BAD_CAST xml.c_str(), "", NULL, options);
     if (doc == NULL)
     {