0

Google spreadsheet gives me an error stating "Imported XML content cannot be parsed" when I try to use the IMPORTXML function.

Cell contents:

=IMPORTXML("http://api.eveonline.com/char/AccountBalance.xml.aspx?keyID=myKey&vCode=myVCode&characterID=myCharID","/eveapi/result/rowset/row@balance")

where myKey, myVCode & myCharID are all valid (accessing the link via address bar with actual keys/IDs gives me a clean XML document).

The XPATH attempts to return the value for attribute "balance" in node "row". eveapi is a root note.

The only information I've found on the web regarding this issue is that IMPORTXML cannot parse js, but there's no js to handle - output is literally a pure XML document.

Rubén
  • 34,714
  • 9
  • 70
  • 166
Mosseman
  • 55
  • 2
  • 6
  • I've got it working by using the Xpath `//@balance`. No idea why that works but the query in the OP doesn't. – Mosseman Apr 22 '14 at 20:54

1 Answers1

2

Your XPath is invalid. Using / you are doing an axis step. However, when you write row@balance you are not doing the required axis step to goi to the balance attribute. Hence, it must be

/eveapi/result/rowset/row/@balance
dirkk
  • 6,160
  • 5
  • 33
  • 51