guest271314 (2019-05-14T07:09:16.000Z)
guest271314 at gmail.com (2019-05-14T07:14:42.146Z)
> I prefer JSON over XML any time but the only area where JSON can't compete with XML is UI. XML is also currently specified as the language used by SSML. Why does a JavaScript plain object need to be created when the XML document itself (returned by `DOMParser`, or the `response` and `responseXML` of `XMLHttpRequest`) can be used to read/write XML values? ``` const createXMLPlainObject = xml_string => Object.create(null, (() => { const xml = (new DOMParser()).parseFromString(`<?xml version="1.0"?>${xml_string}`, "application/xml"); const element = xml.documentElement; return {name:{writable:false,value:element.nodeName},children:{writable:false,value:element.children}} })()); ```
guest271314 at gmail.com (2019-05-14T07:13:15.908Z)
> I prefer JSON over XML any time but the only area where JSON can't compete with XML is UI. XML is also currently specified as the language used by SSML. Why does a JavaScript plain object need to be created when the XML document itself (returned by `DOMParser`, `response` and `responseXML` of `XMLHttpRequest`) can be used to read/write values? ``` const createXMLPlainObject = xml_string => Object.create(null, (() => { const xml = (new DOMParser()).parseFromString(`<?xml version="1.0"?>${xml_string}`, "application/xml"); const element = xml.documentElement; return {name:{writable:false,value:element.nodeName},children:{writable:false,value:element.children}} })()); ```
guest271314 at gmail.com (2019-05-14T07:11:31.665Z)
> I prefer JSON over XML any time but the only area where JSON can't compete with XML is UI. XML is also currently specified as the language used by SSML. Why does a JavaScript plain object need to be created when the XML document itself can be used to read/write values? ``` const createXMLPlainObject = xml_string => Object.create(null, (() => { const xml = (new DOMParser()).parseFromString(`<?xml version="1.0"?>${xml_string}`, "application/xml"); const element = xml.documentElement; return {name:{writable:false,value:element.nodeName},children:{writable:false,value:element.children}} })()); ```
guest271314 at gmail.com (2019-05-14T07:10:53.991Z)
> I prefer JSON over XML any time but the only area where JSON can't compete with XML is UI. XML is also currently specified as the language used by SSML. Why does a JavaScript plain object need to be created when the XML document itself can be used to read/write values? ``` const createXMLPlainObject = xml_string => Object.create(null, (() => { const xml = (new DOMParser()).parseFromString(`<?xml version="1.0"?>${xml_string}`, "application/xml"); const element = xml.documentElement; return {name:{writable:false, value: element.nodeName}, children: {writable: false, value: element.children}} })()); ```