php parsing
| From: | Gert Mellak | Date: | Fri, 10 Sep 2004 09:56:44 +0000 |
| Subject: | php parsing | ||
| Groups: | php.xml.dev | ||
| Request: | Send a blank email to php-xml-dev+get-454@lists.php.net to get a copy of this message | ||
Hi, NG!
I've spent many hours trying to understand why the dom-functions in
php do this and that, but the following I can't understand:
My xml-file looks like:
<Data>
<Article>
<Number>3746</Number>
<Description>This is the article description</Description>
<Groups>
<Group1>Group1</Group1>
<Group2>Group2</Group2>
<Group3>Group3</Group3>
</Groups>
</Article>
</Data>
having the current node "Groups", I call
//-- snip
$childNodes = $curNode->child_nodes();
echo "Number of child-nodes: " . count($childNodes) . "<br>";
//-- /snip
The output is: "Number of child-nodes: 7"
When I echo the node_name() of each child-node, every second node is
called #text
Could anyone of you explain why php reacts like this? I would expect a
child-count of three and definitely no #text-nodes...
Thanks in advance,
Gert.