Re: [PHP] PHP5, XPath and count()

2004-07-24 Thread Christian Stocker
On Sat, 24 Jul 2004 17:35:59 +0200, Victor Boivie <[EMAIL PROTECTED]> wrote: > Christian Stocker wrote: > > >>var_dump($xpath->query("count(/catalog/cd")->item(0)); > > > > > > this doesn't work yet in DOM. The returned value has to be a nodeset. > > Will be fixed some day ;) > > > > Thanks, both

Re: [PHP] PHP5, XPath and count()

2004-07-24 Thread Victor Boivie
Christian Stocker wrote: var_dump($xpath->query("count(/catalog/cd")->item(0)); this doesn't work yet in DOM. The returned value has to be a nodeset. Will be fixed some day ;) Thanks, both Jason and Christian I found something else that I think is strange. $dom = new DOMDocument(); $root = $do

Re: [PHP] PHP5, XPath and count()

2004-07-21 Thread Jason Barnett
this doesn't work yet in DOM. The returned value has to be a nodeset. Will be fixed some day ;) see victors answer for the work around chregu I was wondering about that. So is there someplace online where we can find out what does / does not yet work for XPath? I've been looking but google only

Re: [PHP] PHP5, XPath and count()

2004-07-21 Thread Christian Stocker
On Tue, 20 Jul 2004 22:57:20 +0200, Victor Boivie <[EMAIL PROTECTED]> wrote: > Assume an XML file that looks like: > > > >.. > > >.. > > .. > > > ... and that I would like to know the number of CDs. An xpath expression > would look like count(/catalog/cd), but how do I run

[PHP] PHP5, XPath and count()

2004-07-20 Thread Victor Boivie
Assume an XML file that looks like: .. .. .. ... and that I would like to know the number of CDs. An xpath expression would look like count(/catalog/cd), but how do I run this expression? $dom = new DOMDocument(); $dom->load("catalog.xml"); $xpath = new DOMXpath($dom); var_dump($xp