lloyd / yajl

A fast streaming JSON parsing library in C.
http://lloyd.github.com/yajl
ISC License
2.15k stars 435 forks source link

Is there any possibility to convert JSON to XML in YAJL ver 2.1.0 #224

Closed RambabuTirumalasetty closed 4 years ago

RambabuTirumalasetty commented 4 years ago

Hi Team,

In our implementation we download data from http streaming. As per YAJL documentation I read that, there is a way to convert JSON data to XML format. The below link describes this... /** https://github.com/lloyd/yajl ## YAJL supports stream parsing This means you do not need to hold the whole JSON representation in textual form in memory. This makes YAJL ideal for filtering projects, where you're converting YAJL from one form to another (i.e. XML). The included JSON pretty printer is an example of such a filter program. /

We used YAJL in our implementation to parse JSON data, by using yajl_tree_parse() API. But, this API is not converting our JSON data into XML format.

As per above documentation is there any way to get XML format from JSON data ? If so, then which API will help me to get XML format from JSON data ?

Kindly provide your input on this...

Thanks, Rambabu.

robohack commented 4 years ago

No, there is not any way to convert JSON to XML in YAJL as is.

I'm afraid you've been mislead by the choice of words there. An XML converter would only be an example of a filtering project in which one could make good use of YAJL. Such an example is, as they say in textbooks, left as an exercise to the reader.

RambabuTirumalasetty commented 4 years ago

Hi Robohack,

Thanks for your support. There was a big confusion on YAJL after reading YAJL documentation, weather it can convert JSON data to XML format or not.

Based on your input it is confirmed that YAJL can't convert JSON data to XML fomat.

Thanks, Rambabu.