Class DOMIT_Utilities
A collection of utilities for use with the DOMIT! parser. This class is meant to be called statically.

isPublic? yes
isAbstract? no

Inheritance tree:

DOMIT_Utilities (top level class)

Known subclasses:

None

Source file: xml_domit_utilities.php




Constructor

Signature:

isPublic?




Public Constants



Private Constants



Public Fields



Private Fields



Public Methods
toNormalizedString
Returns a readable representation of the current xml document or node. Called by the DOMIT! method by the same name.

Signature: toNormalizedString()

Returns:

String - A readable representation of the current xml document or node.

Example:

A normalized representation of the xml document is returned:

echo (htmlentities("<pre>" . $myDoc->toNormalizedString(). "</pre>"));

printNode
Prints out the id, nodeName, nodeType, and nodeValue of the specified node.

Signature: printNode(&$node)

Parameters:

DOMIT_Node node - The node whose properties are to be printed.

Returns:

String - A formatted string displaying the id, nodeName, nodeType, and nodeValue of the specified node.

Example:

A formatted string displaying the properties of $someNode is displayed:

echo (htmlentities("<pre>" . $DOMIT_Utilities::printNode($someNode) . "</pre>"));

printNodeAndSiblings
Prints out the id, nodeName, nodeType, and nodeValue of the specified node and all of its siblings.

Signature: printNodeAndSiblings(&$node)

Parameters:

DOMIT_Node node - The node whose properties, and those of its children, are to be printed.

Returns:

String - A formatted string displaying the id, nodeName, nodeType, and nodeValue of the specified node and its siblings.

Example:

A formatted string displaying the properties of $someNode and its siblings is displayed:

echo (htmlentities("<pre>" . $DOMIT_Utilities::printNode($someNode) . "</pre>"));




Private Methods
getNormalizedString
Returns a readable representation of the current xml node. Called by the toNormalizedString() method.

Signature: getNormalizedString(&$node, $node_level)

Parameters:

DOMIT_Node node - The current node to be normalized.

int node_level - The level in the xml tree of the current node.

Returns:

String - A readable representation of the current node.

getIndentation
Sets the indentation for the normalization of the current node.

Signature: getIndentation($node_level)

Parameters:

int node_level - The level in the xml tree of the current node.

Returns:

String - A sequence of spaces corresponding to the indentation width.

validateXML
Performs some minor validation of the xml string about to be parsed. Note that this does not validate against a DTD or XML Schema Definition.

Signature: validateXML($xmlText)

Parameters:

String xmlText - The xml string to be validated.

Returns:

boolean - True is valid, false if invalid.


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