Class DOMIT_Comment
A class representing the DOM Comment node (not present in DOMIT! Lite).

isPublic? yes
isAbstract? no

Inheritance tree:


DOMIT_Node
|
DOMIT_CharacterData
|
DOMIT_Comment

Known subclasses:

None

Source file: xml_domit_parser.php




Constructor
Initializes DOMIT_Comment variables and those of the superclass.

Signature: &DOMIT_Comment($text)

isPublic? no




Public Constants



Private Constants



Public Fields
nodeName
The name of the current node. For DOMIT_Comment, nodeName is #comment.

Type: String

nodeValue
The value of the current node. For DOMIT_Comment, this represents the comment text contained in the node.

Type: String

nodeType
An integer representing the type of the current node. For DOMIT_Comment, nodeType is 8.

Type: int

parentNode
A reference to the node of which the current node is a child.

Type: DOMIT_Node

previousSibling
A reference to the node prior to the current node in the childNodes list. Null if the current node is the first child.

Type: DOMIT_Node

nextSibling
A reference to the node after the current node in the childNodes list. Null if the current node is the last child.

Type: DOMIT_Node

ownerDocument
A reference to the DOMIT_Document. Null if the node has not yet been added to the document.

Type: DOMIT_Document




Private Fields
uid
A unique id assigned to each node. Note that this id is non-persistent.

Type: int




Public Methods
getText
Returns the node value of the text node

Signature: getText()

setText
Sets the nodeValue to the contents of $data.

Signature: setText($data)

Parameters:

string data - The text data of the node.

Example:

The data added as the nodeValue of the comment node.

$someComment->setText('This is a comment');

cloneNode
Returns a copy of the specified node, and if $deep is set to true, all nodes below it in the hierarchy.

Signature: &cloneNode($deep)

Parameters:

boolean deep - True if the children below the cloned node are also to be cloned.

Returns:

DOMIT_Node - The cloned node, with a clone of all subnodes if $deep is set to true.

Example:

In the following example, a node named $styleTemplate is cloned, presumably so the user can create a new style based on the characteristics of the original node.

$newStyle =& styleTemplate->cloneNode(false);

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

Signature: toString($htmlSafe = false)

Parameters:

boolean htmlSafe - If true, returns an html formatted representation of the string.

Returns:

String - A string representation of the comment.




Private Methods
toArray
Returns the text of the comment.

Signature: toArray()

Returns:

string - The text of the comment.


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