Re: Something Wrong with this...
| From: | Christian Stocker | Date: | Sun, 23 Nov 2003 15:36:17 +0000 |
| Subject: | Re: Something Wrong with this... | ||
| References: | 1 | Groups: | php.xml.dev |
| Request: | Send a blank email to php-xml-dev+get-260@lists.php.net to get a copy of this message | ||
On 11/23/03 3:49 PM, PHP wrote:
Hi there, I've used the domxml and find that something is not right... for example.
I run some code like this: xmlfile = "myxml.xml"; $xmldom = domxml_open_file( realpath($xmlfile) ) or die("Couldn't load xmlfile..."); root = $xmldom->document_element(); $node = $root->child_nodes(); echo count($node); // I got 7 children instead of 3Are these TextNodes? They are also child_nodes of an element. chregu
why is did I get 7 children instead of 3 where I suppose to have only 3 children in myxml.xml file therefore if I do something like this: echo $node[*]->get_attribute("Category"); where * is number 1 , 3 and 5 I get results....If the number is 2,4,6 and 7, there will be errors-- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid 0x5CE1DECB