DOMIT! v 0.2 Tutorial
<<    index    >>
1    2    3    4    5    6    7    8    9    10    11    12    13    14    15    16    17   
18    19    20    21    22    23    24    25    26    27    28    29    30    31   
getNodesByNodeType

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.


Documentation generated by ClassyDoc, using the DOMIT! and SAXY parsers.
Please visit Engage Interactive to download free copies.