note 28033 deleted from function.domnode-node-name by sobak
| From: | sobak@php.net | Date: | Tue, 22 Nov 2016 03:40:12 +0000 |
| Subject: | note 28033 deleted from function.domnode-node-name by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207393@lists.php.net to get a copy of this message | ||
Note Submitter: zombie)(at)(localm)(dot)(.org
----
Loop through children making sure that the children are not text nodes.
<pre>
$moduleDoc = domxml_open_file("main_module_defs.xml");
$moduleDefinitionXPath = xpath_new_context($moduleDoc);
$dConvsNodeSet = xpath_eval($moduleDefinitionXPath,
"//modules/module[@name='search']/dConvs");
$children = $dConvsNodeSet->nodeset[0]-> child_nodes();
$dTotal = count($children);
for ($i=0;$i<$dTotal;$i++){
$curNode = $children[$i];
if($curNode->node_name() != "#text"){
echo "This are probably TextNodes..."; }
}
</pre>
--
http://artattack.to