xml ignore whitespace
| From: | Gabino Travassos | Date: | Tue, 18 May 2004 01:40:25 +0000 |
| Subject: | xml ignore whitespace | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186446@lists.php.net to get a copy of this message | ||
Howdy
Here's where I'm at.
$DomDocument = domxml_open_file("myFile.xml");
$RootDomNode = $DomDocument->document_element();
print_r($RootDomNode); // just to test
$listItems = $RootDomNode -> child_nodes(); print_r("<br>there are ".
count($listItems)." child nodes<br>"); // 35!
print_r($listItems);
When I run the above, it pulls in my XML file and counts how many childNodes
there are, then displays them. What I want to do then is run a for loop on
the childNodes, but ... I want to ignore the whitespace nodes. In Flash
there's an ignoreWhite function, is there anything similar in PHP?
I've poked around a bit, and it doesn't look like it.
Thanks for your time.
Gabino