IgoX
Новичок
1C xml & xpath_eval
Есть код
вот что выдает var_dump
object(XPathObject)(4) { [0]=> int(3) [1]=> int(109262976) ["type"]=> int(1) ["nodeset"]=> array(0) { } }
естественно в цикл не входит. Почему не находит, что не так?
Спасибо.
Есть код
PHP:
$xml = join('',file('2.xml'));
$xml = xmldoc($xml);
$xml->xpath_init();
$ctx = xpath_new_context($xml);
$nodes = xpath_eval($ctx,iconv("Windows-1251", "utf-8", "//Товар"));
var_dump($nodes);
foreach($nodes->nodeset as $node)
{
print "xxxxxx";
...........
object(XPathObject)(4) { [0]=> int(3) [1]=> int(109262976) ["type"]=> int(1) ["nodeset"]=> array(0) { } }
естественно в цикл не входит. Почему не находит, что не так?
Спасибо.