Question

I used xpath checker to build the following xpath query:

/eveapi/result/rowset/row[1]/@solarSystemName

on the following XML document:

https://api.eveonline.com/map/Sovereignty.xml.aspx

This works in in xpath checker add on for Firefox however when i put it into a importXML query in Google sheet it does not return any data:

=ImportXML("https://api.eveonline.com/map/Sovereignty.xml.aspx"; "/eveapi/result/rowset/row[1]/@solarSystemName")

any ideas?

Was it helpful?

Solution

The URL is behaving strangely as it returns immediately with a XML with currentTime element, and only after a few seconds the rest of the results are coming.

Probably the spreadsheet is not waiting for the closing tag nor to the rest of the results and returns nothing.

If you try to run

=ImportXML("http://api.eveonline.com/map/Sovereignty.xml.aspx", "//currentTime")

You will the current time of the XML as it is returning before the results.

OTHER TIPS

Apparently attribute names have to be all lower case. This worked for me:

=ImportXML("https://api.eveonline.com/map/Sovereignty.xml.aspx", "//rowset/row/@solarsystemname")

It was pretty painful figuring that out, and let me tell you when I realized that was the issue I wanted to pull out my hair.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top