From: Markus K. <mar...@bs...> - 2011-04-07 13:27:06
|
Cheers Adam, thanks for your help! Will give that a try =) >>> Adam Retter <ad...@ex...> 7.4.2011 15:21 >>> Hmm indeed I just checked here as well and the JSON Serializer in 1.4.x does not seem to function correctly... So I just merged the changes from JSON Serializer in trunk into the 1.4.x branch and all appears to work well. This was committed as revision 14116. You can now checkout the 1.4.x branch and build your own eXist-db and it will work just fine ;-) On 7 April 2011 14:59, Markus Kaindl <mar...@bs...> wrote: > Hi Adam, > > thanks for your fast answer. I had actually tried that, but now I > assume I dont have the most up to date version of the JSONSerializer > because I get this output: > > { "value" : [{ "id" : "id1", "label" : "label1", "value" : "value1"} , > { "id" : "id2", "label" : "label2", "value" : "value2"} ]} > > Dont think <json:value> is working in my version (rev13702) yet...? > > Cheers, > Markus > > >>>> Adam Retter <ad...@ex...> 7.4.2011 14:47 >>> > Its a tricky beast the JSONSerializer and I have really struggled with > it myself! But in this instance the XML that you need to produce for > it is this - > > <json:value> > <json:value> > <id>id1</id> > <label>label1</label> > <value>value1</value> > </json:value> > <json:value> > <id>id2</id> > <label>label2</label> > <value>value2</value> > </json:value> > </json:value> > > Cheers Adam. > > On 7 April 2011 14:29, Markus Kaindl <mar...@bs...> > wrote: >> hy list, >> >> I need the following JSON format which should be transformed from an >> xml structure created by XQuery: >> [ { "id": "id1", "label": "label1", "value": "value1" }, { "id": > "id2", >> "label": "label2", "value": "value2" } ] >> >> I was following the instructions on >> http://atomic.exist-db.org/blogs/eXist/JSONSerializer but I still >> cant produce a structure like that. >> >> The closest I get is [{ "child1" : { "id" : "id1", "value" : > "value1", >> "label" : "label1"} , "child2" : { "id" : "id2", "value" : "value2", >> "label" : "label2"} } ] but thats still not correct because of the >> unnecessary curly brackets and the 'childX' component. I have tried >> solving the problem experimenting with both json:value and >> json:array="true|false" but couldnt get it to work. I am currently > on >> eXist_1.4.1dev-rev13702. Am I doing something wrong here or does > this >> not work (yet)? >> >> TIA for your help! >> >> Cheers, >> Markus >> >> > ------------------------------------------------------------------------------ >> Xperia(TM) PLAY >> It's a major breakthrough. An authentic gaming >> smartphone on the nation's most reliable network. >> And it wants your games. >> http://p.sf.net/sfu/verizon-sfdev >> _______________________________________________ >> Exist-open mailing list >> Exi...@li... >> https://lists.sourceforge.net/lists/listinfo/exist-open >> > > > > -- > Adam Retter > > eXist Developer > { United Kingdom } > ad...@ex... > irc://irc.freenode.net/existdb > > -- Adam Retter eXist Developer { United Kingdom } ad...@ex... irc://irc.freenode.net/existdb |