Hi Chris, I'd be glad to work on this with you. Unfortunately, I'm completely tied up with a couple of other projects for the next few days. I won't have a chance to work on the next version, but I'll let I know as soon as I make some changes.
AJAX: Although I released this as a jQuery plugin, it doesn't actually make any use of jQuery functionality, other than the $.each function. But as you suggested, it does make sense to integrate it with jQuery a bit further and to include ajax. FORMAT: As far as formatting is concerned, I understand that you'd like the output to follow a certain format, but is this really something that is worth working on? Isn't what I've got at the moment enough, ie.: use arrays only when necessary OR always use arrays. Is there really a need to specify which nodes should be arrays and which shouldn't? Serialization/De-serialization: I like the idea (like the firefox about:config page), but what affect would this have on memory? ie.: by doing this, wouldn't we essentially double memory usage by storing every value in data['a.b.c'] as well as data.a.b.c? Again, thank you for your interest in this project. I look forward to your reply... Cheers, Diego A. On Jul 8, 12:11 am, "chris thatcher" <[EMAIL PROTECTED]> wrote: > yeah it would be great to see it ported to a jQuery plugin in combination > with your work and then you could actually use jQuery ajax and it would be > cleaner. I've used it a lot and for me the big thing is the ability to easy > set what elements are treated as array's even if only one is present > (because it keeps the code using it simpler, less cases), and specifying the > attribute prefix (I use '@') because I can basically use e4x like syntax. > > I also made a modification to xotree locally to allow a flat > serialization/deserialization so that the item becomes a list of name/value > objects, the name being the 'javascript path' eg '[EMAIL PROTECTED]' and the > value is the simple value. This was extremely useful for fast development > with GoogleGears because I could have a generic table for all objects and > use the powerful 'name LIKE' queries to find objects stored in the db. > > I'd love to help you develop this or give feedback because it would also > help promote some mvc stuff I'm build for the jQ community. > > Thatcher > > > > On Mon, Jul 7, 2008 at 6:59 PM, Diego <[EMAIL PROTECTED]> wrote: > > > Hi Chris, > > > I hadn't seen xotree before, but I found it... > >http://www.kawa.net/works/js/xml/objtree-e.html > > ...and looking at the examples, it seems to behave exactly like my > > plugin but it's more flexible with options and built-in ajax support. > > > It's definitelly a good base for future development of my plugin... > > > Cheers, > > Diego A. > > > On Jul 7, 8:10 pm, "chris thatcher" <[EMAIL PROTECTED]> > > wrote: > > > Have you looked at xotree.js ? Nice work. > > > > On Mon, Jul 7, 2008 at 10:30 AM, Alexsandro_xpt <[EMAIL PROTECTED]> > > wrote: > > > > > Hi Diego, > > > > > I mean ( 1 ) > > > > > I Know, but would be something like that <xml><person><name>Diego</ > > > > name></person></xml> already great. :) > > > > > Nice plugin.!! > > > > > On 5 jul, 00:06, Diego <[EMAIL PROTECTED]> wrote: > > > > > Hi Alexsandro, > > > > > > Do you mean.... > > > > > (1)"convert the generate JSON back to XML"? > > > > > OR... > > > > > (2)"define a javascript object and convert it to XML"? > > > > > > If (1): > > > > > I initially built this plugin for my personal use (for my > > > > > "convenience") so I could easily process XML data. Because of that, I > > > > > didn't bother to differentiate between attributes / nodes. ie.: > > > > > <xml><person><name>Diego</name></person></xml> > > > > > ...gives the same output as this... > > > > > <xml><person name="Diego"></person></xml> > > > > > ...so it would be impossible to "reverse the conversion". > > > > > > If (2): > > > > > This is quite easy. And actually, it would be pretty similar to the > > > > > code I wrote to show the JSON structure in HTML (Under Examples > > > > > > Basic/Extended Structure) > > > > > > I will write this when I get a chance, but I'd rather wait for the > > > > > feedback on this plugin to work out the best way to do it... > > > > > > Cheers, > > > > > Diego > > > > > > Alexsandro_xpt wrote: > > > > > > Very good!!! > > > > > > > Are possible to do reverse? > > > > > > > -- > > > > > > Alexsandro > > > > > >www.alexsandro.com.br > > > > > > > On 4 jul, 12:34, Diego <[EMAIL PROTECTED]> wrote: > > > > > > > I wrote this a few months but didn't have the time to share it. > > Now > > > > > > > that I've re-done the documentation for 2 of my plugins I thought > > I'd > > > > > > > give it a few hours, knock some examples together and share it > > with > > > > > > > the whole world (ok, maybe just a few people). > > > > > > > > Basic example: > > > > > > > var xml = '<xml><message>Hello world</message></xml>'; > > > > > > > var json = $.xml2json(xml); > > > > > > > alert(json.message); // shows "Hello world" > > > > > > > > Ajax example: > > > > > > > var file = 'data/hello.xml'; //<xml><message>Hello > > world</message></ > > > > > > > xml> > > > > > > > $.get(file, function(xml){ > > > > > > > �var json = $.xml2json(xml); > > > > > > > �alert(json.message); > > > > > > > > }); > > > > > > > > See the documentation page for more examples and demos. > > > > > > > XML to JSON Plugin -http://fyneworks.com/jquery/xml-to-json/ > > > > > > > > As always, feedback is welcome! > > > > > > > > Cheers, > > > > > > > Diego > > > > -- > > > Christopher Thatcher > > -- > Christopher Thatcher