Class DOMIT_NodeList
Provides a container for a 0-indexed sequence of nodes.

isPublic? yes
isAbstract? no

Inheritance tree:

DOMIT_NodeList (top level class)

Known subclasses:

None

Source file: xml_domit_nodemaps.php




Constructor



Public Constants



Private Constants



Public Fields



Private Fields
arNodeList
An array containing the list of DOMIT_Nodes.

Type: array




Public Methods
item
Returns the node at the specified index (0-based).

Signature: &item($index)

Parameters:

int index - The index of the DOMIT_Node to be returned.

Returns:

DOMIT_Node - The DOMIT_Node at the index specified, or null if nothing is found at that location.

Example:

The third node in the node list is returned:

$thirdNode =& myNodeList->item(2);

getLength
Returns the number of nodes in the node list.

Signature: getLength()

Returns:

int - The number of nodes in the node list.

Example:

The number of nodes in the node list are returned:

$numNodes = myNodeList->getLength();

toArray
Returns an array representation of the node list.

Signature: toArray()

Returns:

array - An array representing the node list.

Example:

Prints out an array representing the node list.

print_r($nodelist->toArray());

forHTML
Formats a string for presentation as HTML.

Signature: forHTML($str, $doPrint = false)

Parameters:

String str - The string to be formatted.

boolean doPrint - True if the string is to be sent directly to output.

Returns:

String - The HTML formatted string.

toString
Generates an unformatted (single line, no whitespace) string representation of the DOMIT_NodeList.

Signature: toString($htmlSafe = false, $subEntities=false)

Parameters:

boolean htmlSafe - True if HTML readable output is desired.

boolean subEntities - True if illegal xml characters in text nodes and attributes should be converted to entities.

Returns:

String - The string representation.

Example:

An unformatted string representation of the DOMIT_NodeList will be printed here:

echo $myNodeList->toString(true, true);




Private Methods
appendNode
Appends the specified node to the list. Does not check if the node is already present.

Signature: &appendNode($node)

Parameters:

DOMIT_Node node - The node to be appended.

Returns:

DOMIT_Node - The node that was just appended.

Example:

A node is appended to $myNodeList:

$returnedNode =& myNodeList->appendNode($aNode);

removeNode
Removes the specified node from the list.

Signature: &removeNode($node)

Parameters:

DOMIT_Node node - The node to be removed.

Returns:

DOMIT_Node - The node that was just removed, or null if it wasn't found.

Example:

A node is removed from $myNodeList:

$returnedNode =& myNodeList->removeNode($aNode);

createClone
Used by cloneNode() to generate a new instance of a DOMIT_NodeList containing the same data as the original.

Signature: &createClone($deep)

Parameters:

boolean deep - True if all subnodes are to be cloned.

Returns:

DOMIT_NodeList - A new DOMIT_NodeList


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