cancel
Showing results for 
Search instead for 
Did you mean: 

XML formatter replaces " to &quot

viji28
New Contributor

I have an input to the XML formatter which looks like this 🙂
{
@SEGMENT”: “1”,
“code”: “B00001”,
MVodafone 150" BLACK
“test_p”: [
]
}

when this input is passed to XML formatter, it gives output as below:
“code”: “B00001”,
MVodafone 150amp;quot; BLACK

Note** I have edited the output to place it in the forum.
Is there any way, where we can stop xml formatter from replacing the &quot to &quot ?

1 ACCEPTED SOLUTION

viktor_n
Contributor II

Hi @viji28,

As @j.angelevski said data is not valid so I guess that it should look something like this ?

[
    {
        "@SEGMENT": "1",
        "code": "B00001",
        "MVodafone": "150" BLACK",
        "test_p": []
    }
]

So I tried with this sample, and it should solve your problem if you check the Format as canonical XML field, inside of XML Formatter.

What I received on output with the checked filed:
<RootElement SEGMENT="1"><code>B00001</code><MVodafone>150" BLACK</MVodafone></RootElement>

Regards,

View solution in original post

3 REPLIES 3

j_angelevski
Contributor III

Hi @viji28,
The provided JSON data is not valid, can you share the correct data ?

viktor_n
Contributor II

Hi @viji28,

As @j.angelevski said data is not valid so I guess that it should look something like this ?

[
    {
        "@SEGMENT": "1",
        "code": "B00001",
        "MVodafone": "150&quot; BLACK",
        "test_p": []
    }
]

So I tried with this sample, and it should solve your problem if you check the Format as canonical XML field, inside of XML Formatter.

What I received on output with the checked filed:
<RootElement SEGMENT="1"><code>B00001</code><MVodafone>150" BLACK</MVodafone></RootElement>

Regards,

viji28
New Contributor

Great. This works. Thank you so much.