[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: JSON parse tree example Re: [xdi] Agenda: XDI TC Telecon Friday 09:00 - 10:30AM PT 2013-04-05
This is an example of the kind of parse tree I naturally get from _javascript_ code I'm writing to parse XDI. It is probably similar to the Java data structures Markus's XDI2 creates from parsing XDI. If we can simply JSON-serialize a parse tree that is convenient for programmers, then they can simply JSON-deserialize and use it without more complicated parsing steps. On Apr 4, 2013, at 11:33 PM, Drummond Reed <drummond.reed@xdi.org> wrote:
Version 1: Separate context symbol and identifier Compact: [[{"cs":"=","id":"drummond"},{"cs":"<","id":{"cs":"+","id":"email"}},{"cs":"!","id":"uuid:f81d4fae-7dec-11d0-a765-00a0c91e0001"},{"cs":"<<","id":{"cs":"$","id":"string"}}],{"cs":"<","id":""},"dsr@ex1.com"] Formatted: [ [ { "cs":"=", "id":"drummond" }, { "cs":"<", "id":{ "cs":"+", "id":"email" } }, { "cs":"!", "id":"uuid:f81d4fae-7dec-11d0-a765-00a0c91e0001" }, { "cs":"<<", "id":{ "cs":"$", "id":"string" } } ], { "cs":"<", "id":"" }, "dsr@ex1.com" ] Version 2: Bottom-level context symbol - identifier sequence left in one string. Context functions still (usually>) require separate object. Compact: [["=drummond",{"cs":"<","id":"+email"},"!uuid:f81d4fae-7dec-11d0-a765-00a0c91e0001",{"cs":"<<","id":"$string"}],{"cs":"<"},"dsr@ex1.com"] Formatted: [ [ "=drummond", { "cs":"<", "id":"+email" }, "!uuid:f81d4fae-7dec-11d0-a765-00a0c91e0001", { "cs":"<<", "id":"$string" } ], { "cs":"<" }, "dsr@ex1.com" ] |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]