Browse Source

Merge pull request #13535 from GordonSmith/HPCC-23750-eclcc_keywords

HPCC-23750 eclcc --keywords generates invalid XML

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 5 years ago
parent
commit
b42c3aa37e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      ecl/hql/reservedwords.cpp

+ 4 - 1
ecl/hql/reservedwords.cpp

@@ -15,6 +15,7 @@
     limitations under the License.
 ############################################################################## */
 #include "jfile.hpp"
+#include "jstring.hpp"
 #include "reservedwords.hpp"
 
 struct Keywords
@@ -607,9 +608,11 @@ void printKeywordsToXml()
      {
          buffer.append("  <cat group=\"").append(keywordList[i].group).append("\">\n");
          unsigned int j = 0;
+         StringBuffer encodedStr;
          while(keywordList[i].keywords[j])
          {
-             buffer.append("    <keyword name=\"").append(keywordList[i].keywords[j]).append("\"/>\n");
+             encodedStr.clear();
+             buffer.append("    <keyword name=\"").append(encodeXML(keywordList[i].keywords[j], encodedStr)).append("\"/>\n");
              ++j;
          }
          buffer.append("  </cat>\n");