Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用YQL查询XML服务?_Xml_Web Services_Rest_Yql - Fatal编程技术网

如何使用YQL查询XML服务?

如何使用YQL查询XML服务?,xml,web-services,rest,yql,Xml,Web Services,Rest,Yql,我正在使用来试验查询RESTXMLWeb服务 我找到了一个简单的公共服务 返回 <CUSTOMER xmlns:xlink="http://www.w3.org/1999/xlink"> <ID>-151612345</ID> <FIRSTNAME>Deepthi</FIRSTNAME> <LASTNAME>Deep</LASTNAME> <STREET>440 - 20th Ave

我正在使用来试验查询RESTXMLWeb服务

我找到了一个简单的公共服务

返回

<CUSTOMER xmlns:xlink="http://www.w3.org/1999/xlink">
  <ID>-151612345</ID>
  <FIRSTNAME>Deepthi</FIRSTNAME>
  <LASTNAME>Deep</LASTNAME>
  <STREET>440 - 20th Ave.</STREET>
  <CITY>Los Angeles</CITY>
</CUSTOMER>
我得到了返回的XML。但是,如果我试图将数据限制为单个元素,例如:

select * 
from xml 
where url='http://www.thomas-bayer.com/sqlrest/CUSTOMER/-151612345/' 
  and xpath='//LASTNAME'
不返回任何结果

我做错了什么


根据需要筛选结果的正确键不是
xpath
,而是
itemPath

SELECT *
FROM xml
WHERE url='http://www.thomas-bayer.com/sqlrest/CUSTOMER/-151612345/'
  AND itemPath='//LASTNAME'
()

通过发出查询
desc
,可以查看给定表的键

()

对于
xml
表,
itemPath
可以是XPath表达式或E4X点路径

SELECT *
FROM xml
WHERE url='http://www.thomas-bayer.com/sqlrest/CUSTOMER/-151612345/'
  AND itemPath='//LASTNAME'
desc xml