W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2011

[whatwg] Requesting JSON.toXML

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 30 Sep 2011 14:57:43 -0700
Message-ID: <CAAWBYDCWkirh1CcU92J5C0LrCCNh9eZ7DZ3ZrgmutgCpO1OQ-Q@mail.gmail.com>
On Fri, Sep 30, 2011 at 2:52 PM, Charles Pritchard <chuck at jumis.com> wrote:
> On Sep 30, 2011, at 2:23 PM, "Tab Atkins Jr." <jackalmage at gmail.com> wrote:
>> On Fri, Sep 30, 2011 at 2:19 PM, Charles Pritchard <chuck at 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:
>>>
>>> JSON.toXML({div:'Hello world'});
>>
>> I'm curious why you would want such a thing. ?You can store DOM trees
>> as strings and revive them when used. ?You can transmit DOM across XHR
>> either as a string or, soon, directly as a document.
>>
>> I don't see a reason to store DOM into an alternative JSON structure.
>
> JSON is widely more popular than XML for a lot of APIs. People use JSON.stringify an parse quite a bit. I may be misunderstanding what it is you mean by DOM.

The first paragraph of your original email talked about the Node
methods now accepting DOMStrings.  Since you then asked for a way to
convert JSON to a DOMString, I reasonably assumed the two statements
were related.

I guess I should be more direct, then.  What problem are you
attempting to solve with this feature?

~TJ
Received on Friday, 30 September 2011 14:57:43 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:36 UTC