The getNodesByNodeType method of a DOMIT_Document allows you to search
the document tree for nodes of a specific type.
You can specify a node type using one of the following constants:
- DOMIT_DOCUMENT_NODE (an integer value of 9)
- DOMIT_ELEMENT_NODE (an integer value of 1)
- DOMIT_TEXT_NODE (an integer value of 3)
- DOMIT_CDATA_SECTION_NODE (an integer value of 4)
You must also pass in a contextNode - a node from which the search should start.
The following example returns a DOMIT_NodeLIst of all DOMIT_TextNodes in the current document:
NOTE: in versions of DOMIT! prior to 0.5, this method returned an array, not a DOMIT_NodeList!
$myTextNodeList =& $cdCollection->getNodesByNodeType(DOMIT_TEXT_NODE, $cdCollection);
All the name and title text nodes of the cd collection will be returned in the $myTextNodeList node list.
|