<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hello,</div><div><br></div><div>check this one <a href="https://github.com/talentdeficit/jsx.git">https://github.com/talentdeficit/jsx.git</a></div><div><br></div><div>- Dmitry</div><br><div><div>On Jan 18, 2013, at 2:18 PM, Yash Ganthe <<a href="mailto:yashgt@gmail.com">yashgt@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">
<div lang="EN-US" vlink="purple" link="blue">
<div><p class="MsoNormal">SAX allows the client application to read an XML piece-by-piece. This is different than DOM which expects the entire XML to be loaded in memory. SAX is thus useful for reading very large XML documents.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Mochijson is a good JSON parser which emits structs that correspond to individual JSON strings. It however expects the entire JSON string to be given to its functions.<u></u><u></u></p><p class="MsoNormal">If I have about 10000 records in an JSON such as this,<u></u><u></u></p><p class="MsoNormal">{ "d" : <u></u><u></u></p><p class="MsoNormal">[<u></u><u></u></p><p class="MsoNormal"> {<u></u><u></u></p><p class="MsoNormal"> "ID": 1, "Name": "p1", "Email": "<a href="mailto:p1@p1.com" target="_blank">p1@p1.com</a>"<u></u><u></u></p><p class="MsoNormal"> }, <u></u><u></u></p><p class="MsoNormal"> {<u></u><u></u></p><p class="MsoNormal"> "ID": 2, "Name": "p2", "Email": "<a href="mailto:p2@p2.com" target="_blank">p2@p2.com</a>"<u></u><u></u></p><p class="MsoNormal"> }, <u></u><u></u></p><p class="MsoNormal"> {<u></u><u></u></p><p class="MsoNormal"> "ID": 3, "Name": "p3", "Email": "<a href="mailto:p3@p3.com" target="_blank">p3@p3.com</a>"<u></u><u></u></p><p class="MsoNormal"> }, <u></u><u></u></p><p class="MsoNormal"> {<u></u><u></u></p><p class="MsoNormal"> "ID": 4, "Name": "p4", "Email": "<a href="mailto:p4@p4.com" target="_blank">p4@p4.com</a>"<u></u><u></u></p><p class="MsoNormal"> } . . . . .<u></u><u></u></p><p class="MsoNormal">] }<u></u><u></u></p><p class="MsoNormal">the entire JSON string would have to be first obtained and then passed to mochijson/mochijson2.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I am looking for a way to let the module give me one record at a time from the large JSON-formatted array. Is there any module that lets us do this?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks,<u></u><u></u></p><p class="MsoNormal">Yash</p></div></div></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br></body></html>