1
我正在使用YQL Console來試驗查詢REST XML Web服務。如何使用YQL查詢XML服務?
我找到了一個簡單的公共服務來玩。
http://www.thomas-bayer.com/sqlrest/CUSTOMER/-151612345/
回報
<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>
如果我使用查詢:
select *
from xml
where url='http://www.thomas-bayer.com/sqlrest/CUSTOMER/-151612345/'
我得到這個XML返回。但是,如果我嘗試將數據限制爲單個元素,例如:
select *
from xml
where url='http://www.thomas-bayer.com/sqlrest/CUSTOMER/-151612345/'
and xpath='//LASTNAME'
未返回任何結果。
我在做什麼錯?
Click here to display the YQL console with the query loaded.