1

What I'm trying to do is to extract data from this XML using Google Spreadsheets:

XML File

Now I thought that this would be an easy task and decided to use the ImportXML() function with following XPath sting:

- =IMPORTXML("https://api.eveonline.com/map/FacWarSystems.xml.aspx", "//row[@owningFactionID='500002']")

Which, in theory should return every entry in the document where the owningFactionID is 500002.

Problem is that I only get #N/A in the Google Spreadsheet (Empty).

If someone could help with what I'm doing wrong here I'd be very grateful.

1 Answer 1

2

Your query is correct, but the row elements that are being returned are empty. I assume you want to see the attributes on each row. You need to use something like:

=IMPORTXML("https://api.eveonline.com/map/FacWarSystems.xml.aspx","//row[@owningFactionID='500002']/@*")
Sign up to request clarification or add additional context in comments.

3 Comments

Perfect. This is exactly what I wanted.
Small follow up question: Is there a way to display this in an array like row[1] to row[42] to be able to tell how many of the items fit the requirements or would that be easier to achieve using regex on that xml doc?
@BlubQ I am not too familiar with IMPORTXML. I think you would have more luck opening the script editor and writing a function with apps script that parses the XML into the format you want. developers.google.com/apps-script/guides/services/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.