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

isPublic? yes
isAbstract? no

Inheritance tree:


DOMIT_Node
|
DOMIT_DocumentType

Known subclasses:

None

Source file: xml_domit_parser.php




Constructor
Initializes DOMIT_DocumentType variables and those of the superclass. Note that this is only a partial implementation! Only a text representation of the doctype is currently stored.

Signature: &DOMIT_DocumentType($name, $text)

isPublic? no




Public Constants



Private Constants



Public Fields
nodeName
The name of the current node. For DOMIT_DocumentType, nodeName is the name of the doctype.

Type: String

nodeValue
The value of the current node. For DOMIT_DocumentType, nodeValue is null.

Type: String

nodeType
An integer representing the type of the current node. For DOMIT_DocumentType, nodeType is 10.

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

name
A unique id assigned to each node. Note that this id is non-persistent.

Type: String

entities
A list of entity nodes for the doctype.

Type: DOMIT_NamedNodeMap

notations
A list of notation nodes for the doctype.

Type: DOMIT_NamedNodeMap

elements
A list of element objects for the doctype.

Type: DOMIT_NamedNodeMap




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

Type: int

text
A unique id assigned to each node. Note that this id is non-persistent.

Type: String




Public Methods
getText
Gets the text of the doctype node (not part of DOM spec).

Signature: getText()

Returns:

String - A string containing the text of the doctype node.

Example:

Gets the text of the doctype node:

$doctypeText = $xmldoc->doctype->getText();

getName
Gets the name of the doctype node.

Signature: getNamea()

Returns:

String - A string containing the name of the doctype node.

Example:

Gets the name of the doctype node:

$doctypeName = $xmldoc->doctype->getName();

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 Document Type.

Signature: toString($htmlSafe = false)

Parameters:

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

Returns:

String - A string representation of the Document Type.




Private Methods
toArray
Returns the text of the document type.

Signature: toArray()

Returns:

string - The text of the document type.


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