Navigating XML in LiveCode

Bernard Devlin bdrunrev at gmail.com
Tue Jan 24 07:13:38 EST 2012


You could also consider using JSON instead of XML.  Particularly since
we have 2 libraries around which convert LiveCode arrays to JSON and
vice-versa.  JSON is known as "the fat-free xml".  I don't think
either format is paritcularly easy to scan by the naked eye.  One
library is by Andre, the other by Mark Smith.

Another option would be to use a sqlite database, and have your
program export/backup the database to a series of SQL insert
statements.  I think I'd find that easier to scan with the naked eye
than XML.

I don't understand why a CSV (or tab-separated) text file would not
suit your purposes, but I'll assume it because your data is more
complex than would be suitable to that format.

Bernard


On Mon, Jan 23, 2012 at 4:34 PM, Graham Samuel <livfoss at mac.com> wrote:
> However the real reason that I'm trying to go down the XML route is that I need this data to persist and I don't want the overhead of storing it in a stack rather than just keeping a trivial amount of text which furthermore could be easily examined/edited by non-LC programs.
[...]
> I suppose more generally I'm trying to understand if XML is suitable for this kind of data structure, where there are several nodes identical or similar in structure but containing different data. It looks ideal to me, but the difficulty of finding the last item you added, and of adding attributes at creation time, is giving me doubts. But maybe I'm just confused.




More information about the use-livecode mailing list