Есть такой xml:
CODE ( html):
скопировать код в буфер обмена
<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gsx='http://schemas.google.com/spreadsheets/2006/extended'> <id>https://spreadsheets.google.com/feeds/...</id> <updated>2012-08-29T18:34:00.140Z</updated> <category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/> <title type='text'>...</title> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/.../od8/private/full'/> <link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/.../od8/private/full'/> <openSearch:totalResults>1</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <entry> <id>https://spreadsheets.google.com/feeds/list/.../private/full/e4jxw</id> <updated>2012-08-29T18:34:00.140Z</updated> <category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/> <title type='text'>45</title> <link rel='edit' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/...'/> <gsx:_dw4je>45</gsx:_dw4je> <gsx:разборзапроса>30.08.2012 0:14:24</gsx:разборзапроса> </entry> </feed>
И когда я пишу простой запрос xPath, то он ничего не возвращает и $entrys->length показывает 0:
PHP:
скопировать код в буфер обмена
$dom = new domDocument; $dom->loadXML($xml); $xpath = new DOMXPath($dom); //$xpath->registerNamespace('gsx', 'http://schemas.google.com/spreadsheets/2006'); $entrys = $xpath->query('//feed/entry');
(Отредактировано автором: 30 Августа, 2012 - 17:49:37)
|