PHP Doku:: Returns name of node - function.domnode-node-name.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzXML-ManipulationDOM-XMLDOM-XML-FunktionenDomNode->node_name

Ein Service von Reinhard Neidl - Webprogrammierung.

DOM-XML-Funktionen

<<DomNode->next_sibling

DomNode->node_type>>

DomNode->node_name

(PHP 4 >= 4.1.0)

DomNode->node_name Returns name of node

Beschreibung

string DomNode->node_name ( void )

Returns name of the node. The name has different meanings for the different types of nodes as illustrated in the following table.
Meaning of value
Type Meaning
DomAttribute value of attribute
DomAttribute  
DomCDataSection #cdata-section
DomComment #comment
DomDocument #document
DomDocumentType document type name
DomElement tag name
DomEntity name of entity
DomEntityReference name of entity reference
DomNotation notation name
DomProcessingInstruction target
DomText #text


Ein BenutzerBeitrag:
- Beiträge aktualisieren...
zombie)(at)(localm)(dot)(.org
30.12.2002 19:33
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



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)