ソースを参照

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());
+        }
     }
 };