简体   繁体   English

ImportXML不从XML文件返回数据

[英]ImportXML does not return data from XML file

I used xpath checker to build the following xpath query: 我使用xpath检查器来构建以下xpath查询:

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

on the following XML document: 在以下XML文档上:

https://api.eveonline.com/map/Sovereignty.xml.aspx 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: 这在适用于Firefox的xpath checker addin中起作用,但是当我将其放入Google表格中的importXML查询中时,它不会返回任何数据:

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

any ideas? 有任何想法吗?

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. 弄清楚这一点是非常痛苦的,当我意识到那是我想拔出头发的问题时,让我告诉你。

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. 该URL表现异常,因为它立即返回带有currentTime元素的XML,并且仅在几秒钟之后,其余结果才出现。

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. 您将在结果之前返回XML的当前时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM