Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

XML to JSON policy data conversion issue, 0123 not being treated as an integer

Not applicable

Am i missing something here?

I'm experiencing an issue with data conversion using the XML to JSON policy .

When <RecognizeNumber>true</RecognizeNumber> is set in options of XML to JSON policy

Suppose my input xmlData is

<abc>
<Number>0123</Number>
</abc> 

This is converted to

{
  "abc":  {
    "Number": "0123"
  }
} 

But when Number is not starting with 0 say 1234 the output json is

{
  "abc":  {
    "Number": 1234
  }
}

When <RecognizeNumber>false</RecognizeNumber> then the policy always treats it as a string .

My requirement is to make the xml to json policy always treat it as a Number. How do i do it ?

1 1 1,824
1 REPLY 1