DOM Document constructor
DOMIT_Document
DOMIT_Document
()
Appends a node to the childNodes list of the current node
Object
&appendChild
(Object &$node)
-
Object
&$node: The node to be appended
Redefinition of:
- DOMIT_ChildNodes_Interface::appendChild()
- Appends a node to the childNodes list of the current node
Appends an array of entity mappings to the existing translation table
Intended mainly to facilitate the conversion of non-ASCII entities into equivalent characters
void
appendEntityTranslationTable
(array $table)
-
array
$table: A list of entity mappings in the format: array('&' => '&');
Copies a node and/or its children
Object
&cloneNode
([boolean $deep = false])
-
boolean
$deep: True if all child nodes are also to be cloned
Redefinition of:
- DOMIT_Node::cloneNode()
- Copies a node and/or its children
Creates a new DOMIT_Attr node
Object
&createAttribute
(string $name)
-
string
$name: The name of the attribute
Creates a new DOMIT_Attr node (namespace aware)
Object
&createAttributeNS
(string $namespaceURI, string $qualifiedName)
-
string
$namespaceURI: The namespaceURI of the attribute
-
string
$qualifiedName: The qualifiedName of the attribute
Creates a new DOMIT_CDataSection node
Object
&createCDATASection
(string $data)
-
string
$data: The text of the CDATASection
Creates a new DOMIT_Comment node
Object
&createComment
(string $text)
-
string
$text: The comment text
Creates a new DOMIT_DocumentFragment node
Object
&createDocumentFragment
()
Creates a new DOMIT_Element node
Object
&createElement
(string $tagName)
-
string
$tagName: The tag name of the element
Creates a new DOMIT_Element node (namespace aware)
Object
&createElementNS
(string $namespaceURI, string $qualifiedName)
-
string
$namespaceURI: The namespaceURI of the element
-
string
$qualifiedName: The qualifiedName of the element
Creates a new DOMIT_ProcessingInstruction node
Object
&createProcessingInstruction
(string $target, string $data)
-
string
$target: The target of the processing instruction
-
string
$data: The data of the processing instruction
Creates a new DOMIT_Text node
Object
&createTextNode
(string $data)
-
string
$data: The text of the node
Specifies whether elements tags will be rendered to string as <element></element> rather than <element/>
void
expandEmptyElementTags
(boolean $truthVal, [mixed $expandEmptyElementExceptions = false])
-
boolean
$truthVal: True if the expanded form is to be used
-
mixed
$expandEmptyElementExceptions: An array of tag names that should be excepted from expandEmptyElements rule (optional)
Returns a doctype object
mixed
getDocType
()
Returns a reference to the DOMIT_DOMImplementation object
Object
&getDOMImplementation
()
Returns the element whose ID is given by elementId.
Object
&getElementByID
(string $elementID, [boolean $isStrict = true])
-
string
$elementID: The id of the matching element
-
boolean
$isStrict: True if XML spec is to be strictly adhered to (only attributes xml:id are considered valid)
Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like attribute expression (NOT YET IMPLEMENTED!)
mixed
&getElementsByAttributePath
(string $pattern, int $nodeIndex)
-
string
$pattern: The query pattern
-
int
$nodeIndex: If a single node is to be returned (rather than the entire NodeList) the index of that node
Redefinition of:
- DOMIT_Node::getElementsByAttributePath()
- Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like attribute expression (NOT YET IMPLEMENTED!)
Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like expression.
mixed
&getElementsByPath
(string $pattern, int $nodeIndex)
-
string
$pattern: The query pattern
-
int
$nodeIndex: If a single node is to be returned (rather than the entire NodeList) the index of that node
Redefinition of:
- DOMIT_Node::getElementsByPath()
- Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like expression.
Retrieves a NodeList of child elements with the specified tag name
Object
&getElementsByTagName
(string $tagName)
-
string
$tagName: The matching element tag name
Retrieves a NodeList of child elements with the specified namespaceURI and localName
Object
&getElementsByTagNameNS
(string $namespaceURI, string $localName)
-
string
$namespaceURI: The matching namespaceURI
-
string
$localName: The matching localName
Returns the error code from the underlying SAX parser
int
getErrorCode
()
Returns the error string from the underlying SAX parser
string
getErrorString
()
Retrieves all child nodes of the specified nodeType
Object
&getNodesByNodeType
(string $type, Object &$contextNode)
-
string
$type: The nodeType of matching nodes
-
Object
&$contextNode: The root node of the search
Retrieves all child nodes of the specified nodeValue
Object
&getNodesByNodeValue
(string $value, Object &$contextNode)
-
string
$value: The nodeValue of matching nodes
-
Object
&$contextNode: The root node of the search
Returns the concatented text of the current node and its children
string
getText
()
Redefinition of:
- DOMIT_Node::getText()
- Returns the concatented text of the current node and its children
Retrieves text from a file
string
getTextFromFile
(string $filename)
-
string
$filename: The file path
Returns the current version of DOMIT!
Object
getVersion
()
Returns the xml declaration processing instruction
mixed
getXMLDeclaration
()
Imports a node (and optionally its children) from another DOM Document
object The
&importNode
(object A &$importedNode, [boolean $deep = true])
-
object A
&$importedNode: reference to the node to be imported
-
boolean
$deep: True if the children of the imported node are also to be imported
Inserts a node to the childNodes list of the current node
Object
&insertBefore
(Object &$newChild, Object &$refChild)
-
Object
&$newChild: The node to be inserted
-
Object
&$refChild: The node before which the insertion is to occur
Redefinition of:
- DOMIT_ChildNodes_Interface::insertBefore()
- Inserts a node to the childNodes list of the current node
Manages the firing of the onLoad() event
void
load
(Object &$contextNode)
-
Object
&$contextNode: The parent node of the current recursion
Parses an xml file
boolean
loadXML
(string $filename, [boolean $useSAXY = true], [boolean $preserveCDATA = true], [boolean $fireLoadEvent = false])
-
string
$filename: The xml file to be parsed
-
boolean
$useSAXY: True if SAXY is to be used instead of Expat
-
boolean
$preserveCDATA: False if CDATA Section are to be generated as Text nodes
-
boolean
$fireLoadEvent: True if onLoad is to be called on each node after parsing
Indicates the SAX parser used to parse the current document
string
parsedBy
()
Parses an xml string
boolean
parseXML
(string $xmlText, [boolean $useSAXY = true], [boolean $preserveCDATA = true], [boolean $fireLoadEvent = false])
-
string
$xmlText: The xml text to be parsed
-
boolean
$useSAXY: True if SAXY is to be used instead of Expat
-
boolean
$preserveCDATA: False if CDATA Section are to be generated as Text nodes
-
boolean
$fireLoadEvent: True if onLoad is to be called on each node after parsing
Removes a node from the childNodes list of the current node
Object
&removeChild
(Object &$oldChild)
-
Object
&$oldChild: The node to be removed
Redefinition of:
- DOMIT_ChildNodes_Interface::removeChild()
- Removes a node from the childNodes list of the current node
Replaces a node with another
Object
&replaceChild
(Object &$newChild, Object &$oldChild)
-
Object
&$newChild: The new node
-
Object
&$oldChild: The old node
Redefinition of:
- DOMIT_ChildNodes_Interface::replaceChild()
- Replaces a node with another
Specifies whether DOMIT! will try to fix invalid XML before parsing begins
void
resolveErrors
(boolean $truthVal)
-
boolean
$truthVal: True if errors are to be resolved
Saves text to a file
boolean
saveTextToFile
(string $filename, string $text)
-
string
$filename: The file path
-
string
$text: The text to be saved
Saves the current DOM document as an xml file
boolean
saveXML
(string $filename, [boolean $normalized = false])
-
string
$filename: The path of the xml file
-
boolean
$normalized: True if xml text is to be normalized before saving
Specifies basic authentication for an http connection
void
setAuthorization
(string $user, string $password)
-
string
$user: The user name
-
string
$password: The password
Specifies the parameters of the http conection used to obtain the xml data
void
setConnection
(string $host, [string $path = '/'], [int $port = 80], int $timeout, [string $user = null], [string $password = null])
-
string
$host: The ip address or domain name of the connection
-
string
$path: The path of the connection
-
int
$port: The port that the connection is listening on
-
int
$timeout: The timeout value for the connection
-
string
$user: The user name, if authentication is required
-
string
$password: The password, if authentication is required
Set the specified node as document element
Object
&setDocumentElement
(Object &$node)
-
Object
&$node: The node that is to become document element
Specifies whether DOMIT! processes namespace information
void
setNamespaceAwareness
(boolean $truthVal)
-
boolean
$truthVal: True if namespaces are to be processed
Specifies basic authentication for the proxy
void
setProxyAuthorization
(string $user, string $password)
-
string
$user: The user name
-
string
$password: The password
Specifies that a proxy is to be used to obtain the xml data
void
setProxyConnection
(string $host, [string $path = '/'], [int $port = 80], int $timeout, [string $user = null], [string $password = null])
-
string
$host: The ip address or domain name of the proxy
-
string
$path: The path to the proxy
-
int
$port: The port that the proxy is listening on
-
int
$timeout: The timeout value for the connection
-
string
$user: The user name, if authentication is required
-
string
$password: The password, if authentication is required
Generates an array representation of the node and its children
Array
toArray
()
Redefinition of:
- DOMIT_Node::toArray()
- Generates an array representation of the node and its children
Generates a string representation of the node and its children
string
toString
([boolean $htmlSafe = false], [boolean $subEntities = true])
-
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
Imports a node (and optionally its children) from another DOM Document
object The
&_importNode
(object A &$parentNode, object A &$sourceNode, boolean $deep)
-
object A
&$parentNode: reference to the parent of the node to be imported
-
object A
&$sourceNode: reference to the node to be imported
-
boolean
$deep: True if the children of the imported node are also to be imported
Inherited Methods
Inherited From DOMIT_ChildNodes_Interface
DOMIT_ChildNodes_Interface::DOMIT_ChildNodes_Interface()
DOMIT_ChildNodes_Interface::appendChild()
DOMIT_ChildNodes_Interface::getElementsByAttribute()
DOMIT_ChildNodes_Interface::insertBefore()
DOMIT_ChildNodes_Interface::removeChild()
DOMIT_ChildNodes_Interface::replaceChild()
DOMIT_ChildNodes_Interface::selectNodes()
DOMIT_ChildNodes_Interface::_getElementsByAttribute()
Inherited From DOMIT_Node
DOMIT_Node::DOMIT_Node()
DOMIT_Node::appendChild()
DOMIT_Node::clearReferences()
DOMIT_Node::cloneNode()
DOMIT_Node::forHTML()
DOMIT_Node::getChildNodeIndex()
DOMIT_Node::getElementsByAttributePath()
DOMIT_Node::getElementsByPath()
DOMIT_Node::getNamedElements()
DOMIT_Node::getText()
DOMIT_Node::getTypedNodes()
DOMIT_Node::getValuedNodes()
DOMIT_Node::hasAttributes()
DOMIT_Node::hasChildNodes()
DOMIT_Node::insertBefore()
DOMIT_Node::isSupported()
DOMIT_Node::normalize()
DOMIT_Node::nvl()
DOMIT_Node::onLoad()
DOMIT_Node::removeChild()
DOMIT_Node::replaceChild()
DOMIT_Node::setOwnerDocument()
DOMIT_Node::toArray()
DOMIT_Node::toNormalizedString()
DOMIT_Node::_constructor()