Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

XML Headers cannot start with numbers, so an error like this means somewhere within the JSON there is a key value that starts with a number, or an invalid character.  In the below JSON, we can see a key that starts with a the number 9. This cannot be converted to XML, so the invalid character(s) need to be removed and replaced. 


Code Block
"flags_options": {
"9": {
"trusted": true
}
},
"trusted": true


For example, in this case the following replaceAll() expression can be used to remove the replace the key with the text "number"


Code Block
replaceAll($cleanJSON,'"\\d+":','"number":')


See Regular Expressions

Examples

If we add some xml into a $-variable:

...