Skip to content
Browse files

Make sure that underscores are properly escaped in the "MarkLogic" fl…

…avor of JSON
  • Loading branch information...
1 parent 7461d42 commit 177f8d0caf4c24bd31b88cc82d40250a735ce1c2 @ndw committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/com/xmlcalabash/util/JSONtoXML.java
View
5 src/com/xmlcalabash/util/JSONtoXML.java
@@ -227,8 +227,9 @@ private static void serializeMarkLogic(TreeWriter tree, Object json, String name
localName = "";
for (int pos = 0; pos < name.length(); pos++) {
int ch = name.charAt(pos);
- if ((pos == 0 && XMLCharacterData.isNCNameStart10(ch))
- || (pos > 0 && XMLCharacterData.isNCName10(ch))) {
+ if ('_' != ch
+ && ((pos == 0 && XMLCharacterData.isNCNameStart10(ch))
+ || (pos > 0 && XMLCharacterData.isNCName10(ch)))) {
localName += Character.toString((char) ch);
} else {
localName += String.format("_%04x", ch);

0 comments on commit 177f8d0

Please sign in to comment.
Something went wrong with that request. Please try again.