Yes, you wouldn't want to use XML 'just because', but there are still a bunch of IoT services that use XML.
As well as @opichals UPnP, a good example is RSS. I know it's probably getting less popular now, but having a proper way to parse that data would be great. Not just for news, but things like the weather are often XML.
When I've done stuff with it in the past I've just used string searching hacks to get the data I want (eg. https://youtu.be/-Ag55U2BTK8?t=856
) but it'd be far better to be able to drag out the data.
@opichals yes, definitely we'd have to have something that avoided recursing too much - I think it should be reasonably easy.
In terms of API it'd be nice to have something 'standard' - but failing that the Compact JSON format used by https://www.npmjs.com/package/xml-js looks possible. Having said that they point out that multiple nodes of the same type get handled differently (node:{a_node} vs node:[{a_node},{a_node}]) and I wonder whether a cut down DOM really uses that much more memory.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes, you wouldn't want to use XML 'just because', but there are still a bunch of IoT services that use XML.
As well as @opichals UPnP, a good example is RSS. I know it's probably getting less popular now, but having a proper way to parse that data would be great. Not just for news, but things like the weather are often XML.
When I've done stuff with it in the past I've just used string searching hacks to get the data I want (eg. https://youtu.be/-Ag55U2BTK8?t=856
) but it'd be far better to be able to drag out the data.
@opichals yes, definitely we'd have to have something that avoided recursing too much - I think it should be reasonably easy.
In terms of API it'd be nice to have something 'standard' - but failing that the Compact JSON format used by https://www.npmjs.com/package/xml-js looks possible. Having said that they point out that multiple nodes of the same type get handled differently (
node:{a_node}
vsnode:[{a_node},{a_node}]
) and I wonder whether a cut down DOM really uses that much more memory.