Unable to read XML output

(Naran M) #1

Hi,

I have a web service which returns an XML output ( example as shown below). I want to make use of card set but unable to read the nodes of it. What’s the best possible method to read XML nodes

Thanks,
Naran

> Body
> <?xml version="1.0" encoding="UTF-8"?>
> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
> <products>
> <product>
> 	<id_default_image xlink:href="http://www.example.com/api/images/products/194/1425" not_filterable="true"><1425></id_default_image>
> 	<name><language id="1" xlink:href="http://www.example.com/api/languages/1"><Bossweld 205 Digi Tig DC></language></name>
> </product>
> </products>
> </prestashop>
(Joe Hatch) #2

https://www.google.co.uk/amp/s/davidwalsh.name/convert-xml-json/amp

Somebody has done a writte up on how they’ve converted XML to JSON in JavaScript. You can achieve this from the code service. I’m on mobile at the moment so can’t expand! Take a look. Hope it helps

(Naran M) #3

Thanks Joe for the link. I did get this working finally, the HTTP request is already converting the xml object to JSON output. I had difficulty initially in reading through inner key attributes which got resolved.

-Naran