瀏覽代碼

HPCC-10674 Update based on review

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Anthony Fishbeck 10 年之前
父節點
當前提交
ec708720a2
共有 1 個文件被更改,包括 8 次插入5 次删除
  1. 8 5
      thorlcr/activities/xmlwrite/thxmlwrite.cpp

+ 8 - 5
thorlcr/activities/xmlwrite/thxmlwrite.cpp

@@ -57,12 +57,15 @@ public:
         props.setProp("@format", "utf8n");
         props.setProp("@kind", (kind==TAKjsonwrite) ? "json" : "xml");
 
-        StringBuffer s;
-        OwnedRoxieString supplied(helper->getHeader());
-        props.setPropInt("@headerLength", buildJsonHeader(s, supplied, rowTag).length());
+        if (kind==TAKjsonwrite)
+        {
+            StringBuffer s;
+            OwnedRoxieString supplied(helper->getHeader());
+            props.setPropInt("@headerLength", buildJsonHeader(s, supplied, rowTag).length());
 
-        supplied.set(helper->getFooter());
-        props.setPropInt("@footerLength", buildJsonFooter(s.clear(), supplied, rowTag).length());
+            supplied.set(helper->getFooter());
+            props.setPropInt("@footerLength", buildJsonFooter(s.clear(), supplied, rowTag).length());
+        }
     }
 };