× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am looking into trying to read through one set of JSON data and write
certain objects/trees to a new JSON file.

Example:
yajl_genOpen(*OFF);
yajl_beginObj(); //main JSON object
yajl_beginArray('newList');

// load the old JSON data from a stream file
docNode = yajl_stmf_load_tree(jsonFile);

//find the array "list"
myList = YAJL_object_find(docNode: 'list');

i = 0;

dow YAJL_ARRAY_LOOP(myList:i:node );
yajl_beginObj();

//****write the contents of the "node" array object to the new JSON
buffer*****
yajl_endObj();
enddo;

yajl_tree_free(docNode);

yajl_endArray(); //newList
yajl_endObj(); //main JSON object
yajl_genClose();


I have tried:

yajl_addChar(yajl_stringifyStr(node));

But that stringifies and "escapes" the old JSON data. So what I'm looking
for is something like:

yajl_addNode(node);

Where it will take a node loaded from another JSON object and add it
directly to the new JSON buffer. Not sure if that's possible. Just want
to make sure there isn't something already out there that may do this
before I try digging into making a solution.

Thanks!

Bradley V. Stone
www.bvstools.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.