3 ms·
It depends on the API of the system. I’ve worked on middleware that would not be able to get an attribute, it lacked the capability. Other systems used JavaScri
by wil421 7y ago
It depends on the API of the system. I’ve worked on middleware that would not be able to get an attribute, it lacked the capability. Other systems used JavaScript and it was much easier with JSON
See this link on stack exchange[1].
[1] https://stackoverflow.com/questions/17604071/parse-xml-using-javascript https://stackoverflow.com/questions/17604071/parse-xml-using...
> //Gets Street name
xmlDoc.getElementsByTagName("street")[0].childNodes[0].nodeValue;
I’d much prefer something like jsonObj.address[0].street;. Personally I like to work with objects over parsing documents trees.