Re: [whatwg] Requesting JSON.toXML

2011-10-01 Thread Anne van Kesteren
On Sat, 01 Oct 2011 00:03:21 +0200, Charles Pritchard ch...@jumis.com wrote: Anne has overloaded Node.appendChild with DOMString. That makes appendChild('divhello world/div'); easier. That's my understanding, anyway. You misunderstood. It will append a Text node whose data is the given

Re: [whatwg] Requesting JSON.toXML

2011-10-01 Thread Leo Dutra ™
I think the best would be Node JSON.toXML({ div:'Hello world' }). Just like the XHR responseXML. I really think it's better to work with the node directly, and this way is more like all the common DOM operations with nodes and all. I expect a XML Document node from this operation. -- *Leo

Re: [whatwg] Requesting JSON.toXML

2011-10-01 Thread Leo Dutra ™
And we could have a JSON.toDOMString(...) if really needed, generating a xml string. -- *Leo Dutra**, *on* **Google+* http://www.gplus.to/leodutra* *and* Twitterhttp://www.twitter.com/leodutra * Em 1 de outubro de 2011 20:15, Leo Dutra ™ leodutra...@gmail.com escreveu: I think the best would

[whatwg] Requesting JSON.toXML

2011-09-30 Thread Charles Pritchard
Now that DOM4 includes DOMString as an argument type for Node methods, I'd like to have a clear and easy path to serialize a JSON object into an XML DOMString. It's not a trivial task. Any takers? Example: JSON.toXML({div:'Hello world'}); -Charles

Re: [whatwg] Requesting JSON.toXML

2011-09-30 Thread Tab Atkins Jr.
On Fri, Sep 30, 2011 at 2:19 PM, Charles Pritchard ch...@jumis.com wrote: Now that DOM4 includes DOMString as an argument type for Node methods, I'd like to have a clear and easy path to serialize a JSON object into an XML DOMString. It's not a trivial task. Any takers? Example:

Re: [whatwg] Requesting JSON.toXML

2011-09-30 Thread Charles Pritchard
On Sep 30, 2011, at 2:23 PM, Tab Atkins Jr. jackalm...@gmail.com wrote: On Fri, Sep 30, 2011 at 2:19 PM, Charles Pritchard ch...@jumis.com wrote: Now that DOM4 includes DOMString as an argument type for Node methods, I'd like to have a clear and easy path to serialize a JSON object into

Re: [whatwg] Requesting JSON.toXML

2011-09-30 Thread Tab Atkins Jr.
On Fri, Sep 30, 2011 at 2:52 PM, Charles Pritchard ch...@jumis.com wrote: On Sep 30, 2011, at 2:23 PM, Tab Atkins Jr. jackalm...@gmail.com wrote: On Fri, Sep 30, 2011 at 2:19 PM, Charles Pritchard ch...@jumis.com wrote: Now that DOM4 includes DOMString as an argument type for Node methods, I'd

Re: [whatwg] Requesting JSON.toXML

2011-09-30 Thread Charles Pritchard
On 9/30/11 2:23 PM, Tab Atkins Jr. wrote: On Fri, Sep 30, 2011 at 2:19 PM, Charles Pritchardch...@jumis.com wrote: Now that DOM4 includes DOMString as an argument type for Node methods, I'd like to have a clear and easy path to serialize a JSON object into an XML DOMString. It's not a

Re: [whatwg] Requesting JSON.toXML

2011-09-30 Thread Charles Pritchard
On 9/30/11 2:57 PM, Tab Atkins Jr. wrote: On Fri, Sep 30, 2011 at 2:52 PM, Charles Pritchardch...@jumis.com wrote: On Sep 30, 2011, at 2:23 PM, Tab Atkins Jr.jackalm...@gmail.com wrote: On Fri, Sep 30, 2011 at 2:19 PM, Charles Pritchardch...@jumis.com wrote: Now that DOM4 includes

Re: [whatwg] Requesting JSON.toXML

2011-09-30 Thread Bronislav Klučka
hi 1/ Looking at the example below and the I'd like to skip the population of a DOM via: for(var i in obj) { dom.appendChild(i); }; from mail in this thread, you have certain nativity about XML... the element does not only have content, but also attributes, so each element would have to