< inside attributes after converting json to xml
I am converting a json into an xml using option cdata set to true. All tags apear correctly, except the '<' character situated inside the tags attributes that is replaces with '<'. The character '>' is not replaced and is correct. For example json like this:
{
"foo": {
"$": {
"name": "Some text here with inside <> characters"
}
}
is going to be builded to xml like this:
<foo name="Some text here with inside <> characters"></foo>
Are you sure that this doesn't comply to the XML v1 spec? https://www.w3.org/TR/xml/#syntax
It seems to indicate that exactly what you say is happening should happen... The < MUST be replaced with < The < may be replaced (but does not have to be, unless it appears to be a terminator for a CDATA section when it is not actually a terminator for a CDATA section.. then it MUST be replaced)