1
可能重複:
Xpath fails if an element has a a xmlns attribute的XPath不正確的查詢路徑
我一直在努力了很長時間來提取下面的XML字符串,沒有運氣 http://chris.photobooks.com/xml/default.htm?state=8T
我正在嘗試獲取一本書的ASIN號碼,我試過
$xpath->query('//MarketplaceASIN/ASIN')->item(0)->nodeValue;
和
$xpath->query('/GetMatchingProductResponse/GetMatchingProductResult[1]/Product/Identifiers/MarketplaceASIN/ASIN')->item(0)->nodeValue;
但既不似乎工作,我究竟做錯了什麼?
非常感謝你,那5個小時的睡眠我不會回來 –