Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON - is there any XML CDATA equivalent?

I'm looking for a way that json parsing will take information as is (as if it was CDATA) - and not to try to serialize that. We use both .net and java (client and server) - so the answer should be about JSON structure Is there any way to achieve this structure?

Thanks.

like image 309
user1025852 Avatar asked Feb 18 '13 12:02

user1025852


People also ask

Can JSON parse XML?

JSON and XML are “self describing” nature. JSON and XML are hierarchical. We can parse JSON and XML.

Can we send blob in JSON?

JSON is just a encoding for objects, and you can't really send the implementation-dependent binary structure get around some parse function.

WHAT IS <![ CDATA in XML?

CDATA stands for Character Data and it means that the data in between these strings includes data that could be interpreted as XML markup, but should not be. The key differences between CDATA and comments are: As Richard points out, CDATA is still part of the document, while a comment is not.


1 Answers

There is no XML CDATA equivalent in JSON. But you can encode your message in a string literal using something like base64. See this question for more details.

like image 106
almalki Avatar answered Sep 29 '22 04:09

almalki