[mapguide-commits] r8821 - sandbox/jng/clean_json/Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Nov 8 07:57:41 PST 2015


Author: jng
Date: 2015-11-08 07:57:41 -0800 (Sun, 08 Nov 2015)
New Revision: 8821

Modified:
   sandbox/jng/clean_json/Web/src/HttpHandler/XmlJsonConvert.cpp
   sandbox/jng/clean_json/Web/src/HttpHandler/XmlJsonConvert.h
Log:
Left out passing bClean down in more places

Modified: sandbox/jng/clean_json/Web/src/HttpHandler/XmlJsonConvert.cpp
===================================================================
--- sandbox/jng/clean_json/Web/src/HttpHandler/XmlJsonConvert.cpp	2015-11-08 15:31:48 UTC (rev 8820)
+++ sandbox/jng/clean_json/Web/src/HttpHandler/XmlJsonConvert.cpp	2015-11-08 15:57:41 UTC (rev 8821)
@@ -146,7 +146,7 @@
         if (nodeList->size() == 1)
         {
             childNode = (*nodeList)[0];
-            this->ProcessObjectNode(childNode);
+            this->ProcessObjectNode(childNode, bClean);
         }
         else
         {
@@ -156,7 +156,7 @@
                 for (int i = 0; i < nodeListLength; i++)
                 {
                     childNode = (*nodeList)[i];
-                    this->ProcessArrayNode(i, childNode);
+                    this->ProcessArrayNode(i, childNode, bClean);
                 }
             }
             m_jsonDoc.EndArray();
@@ -179,7 +179,7 @@
     return isValidText;
 }
 
-void MgXmlJsonConvert::ProcessObjectNode(DOMNode *node)
+void MgXmlJsonConvert::ProcessObjectNode(DOMNode *node, bool bClean)
 {
     short nodeType = node->getNodeType();
     string nodeName;
@@ -231,13 +231,13 @@
     m_jsonDoc.BeginArray(1, nodeName);
     m_jsonDoc.BeginArrayObject(0);
     {
-        this->XmlToJsonNode(node);
+        this->XmlToJsonNode(node, bClean);
     }
     m_jsonDoc.EndArrayObject();
     m_jsonDoc.EndArray();
 }
 
-void MgXmlJsonConvert::ProcessArrayNode(int index, DOMNode *node)
+void MgXmlJsonConvert::ProcessArrayNode(int index, DOMNode *node, bool bClean)
 {
     short nodeType = node->getNodeType();
     string nodeName;
@@ -283,7 +283,7 @@
     // Write the node as a single array element
     m_jsonDoc.BeginArrayObject(index);
     {
-        this->XmlToJsonNode(node);
+        this->XmlToJsonNode(node, bClean);
     }
     m_jsonDoc.EndArrayObject();
 }

Modified: sandbox/jng/clean_json/Web/src/HttpHandler/XmlJsonConvert.h
===================================================================
--- sandbox/jng/clean_json/Web/src/HttpHandler/XmlJsonConvert.h	2015-11-08 15:31:48 UTC (rev 8820)
+++ sandbox/jng/clean_json/Web/src/HttpHandler/XmlJsonConvert.h	2015-11-08 15:57:41 UTC (rev 8821)
@@ -44,10 +44,10 @@
     void ToJson(const string &xmlString, string &jsonString, bool bClean = false);
 
 private:
-    void XmlToJsonNode(DOMNode *node, bool bClean = false);
+    void XmlToJsonNode(DOMNode *node, bool bClean);
     bool ValidateTextContent(const string &textContent);
-    void ProcessObjectNode(DOMNode *node);
-    void ProcessArrayNode(int index, DOMNode *node);
+    void ProcessObjectNode(DOMNode *node, bool bClean);
+    void ProcessArrayNode(int index, DOMNode *node, bool bClean);
 
     static bool GetElementPath(DOMNode* node, string& path, const XMLCh* suffix = L"");
     static bool GetElementType(DOMNode* node, int& type, const XMLCh* suffix = L"");



More information about the mapguide-commits mailing list