Parsing XML response in webhook?

Hi,

I’m fetching weather data from met.no, and the response is rather lengthy.

Because of this, I would like to filter it a bit and only return the salient values rather than parsing it locally on the Photon, however they only offer an XML formatted response.

Is it possible to parse an XML response in a webhook, or does it only do JSON? I couldn’t really find anything specific about this in the docs.

Any help is appreciated:)

Sorry, there is no support for parsing XML in a webhook.

What I would do is write a simple server in node.js. It has good support for parsing XML, and then use the particle-api-js to make Particle publish calls directly to your device. Or use a mixture of publish and subscribe, as appropriate.

1 Like