Class DOMIT_Lite_Document

Description

A class representing the DOM Document

Located in /includes/domit/xml_domit_lite_parser.php (line 620)

DOMIT_Lite_Node
   |
   --DOMIT_Lite_ChildNodes_Interface
      |
      --DOMIT_Lite_Document
Direct descendents
Class Description
dom_xmlrpc_domit_lite_document Wraps a DOMIT_Lite DOM document in the DOM XML-RPC API
Variable Summary
Method Summary
DOMIT_Lite_Document DOMIT_Lite_Document ()
Object &appendChild (Object &$node)
void appendEntityTranslationTable (array $table)
Object &cloneNode ([boolean $deep = false])
Object &createCDATASection (string $data)
Object &createElement (string $tagName)
Object &createTextNode (string $data)
void expandEmptyElementTags (boolean $truthVal, [mixed $expandEmptyElementExceptions = false])
string getDocType ()
mixed &getElementsByPath (string $pattern, int $nodeIndex)
Object &getElementsByTagName (string $tagName)
int getErrorCode ()
string getErrorString ()
string getText ()
string getTextFromFile (string $filename)
Object getVersion ()
Object &insertBefore (Object &$newChild, Object &$refChild)
void load (Object &$contextNode)
boolean loadXML (string $filename, [boolean $useSAXY = true], [boolean $preserveCDATA = true], [boolean $fireLoadEvent = false])
boolean loadXML_utf8 (string $filename, [boolean $useSAXY = true], [boolean $preserveCDATA = true], [boolean $fireLoadEvent = false])
string parsedBy ()
boolean parseXML (string $xmlText, [boolean $useSAXY = true], [boolean $preserveCDATA = true], [boolean $fireLoadEvent = false])
boolean parseXML_utf8 (string $xmlText, [boolean $useSAXY = true], [boolean $preserveCDATA = true], [boolean $fireLoadEvent = false])
Object &removeChild (Object &$oldChild)
Object &replaceChild (Object &$newChild, Object &$oldChild)
void resolveErrors (boolean $truthVal)
boolean saveTextToFile (string $filename, string $text)
boolean saveXML (string $filename, [boolean $normalized = false])
boolean saveXML_utf8 (string $filename, [boolean $normalized = false])
void setAuthorization (string $user, string $password)
void setConnection (string $host, [string $path = '/'], [int $port = 80], int $timeout, [string $user = null], [string $password = null])
Object &setDocumentElement (Object &$node)
void setProxyAuthorization (string $user, string $password)
void setProxyConnection (string $host, [string $path = '/'], [int $port = 80], int $timeout, [string $user = null], [string $password = null])
mixed setXMLDeclaration (mixed $decl)
Array toArray ()
string toString ([boolean $htmlSafe = false], [boolean $subEntities = true])
Variables
Array $definedEntities = array() (line 632)
  • var: User defined translation table for XML entities
string $doctype (line 624)
  • var: The doctype text
Object $documentElement (line 626)
  • var: A reference to the root node of the DOM document
boolean $doExpandEmptyElementTags = false (line 636)
  • var: If true, elements tags will be rendered to string as <element></element> rather than <element/>
boolean $doResolveErrors = false (line 634)
  • var: If true, loadXML or parseXML will attempt to detect and repair invalid xml
int $errorCode = 0 (line 640)
  • var: The error code returned by the SAX parser
string $errorString = '' (line 642)
  • var: The error string returned by the SAX parser
array $expandEmptyElementExceptions = array() (line 638)
  • var: A list of exceptions to the empty element expansion rule
object A $httpConnection = null (line 644)
  • var: reference to a http connection or proxy server, if one is required
Object $implementation (line 630)
  • var: A reference to the DOMIT_DOMImplementation object
string $parser (line 628)
  • var: The parser used to process the DOM document, either "EXPAT" or "SAXY_LITE"
string $xmlDeclaration (line 622)
  • var: The xml declaration text

Inherited Variables

Inherited from DOMIT_Lite_Node

DOMIT_Lite_Node::$attributes
DOMIT_Lite_Node::$childCount
DOMIT_Lite_Node::$childNodes
DOMIT_Lite_Node::$firstChild
DOMIT_Lite_Node::$lastChild
DOMIT_Lite_Node::$nextSibling
DOMIT_Lite_Node::$nodeName
DOMIT_Lite_Node::$nodeType
DOMIT_Lite_Node::$nodeValue
DOMIT_Lite_Node::$ownerDocument
DOMIT_Lite_Node::$parentNode
DOMIT_Lite_Node::$previousSibling
DOMIT_Lite_Node::$uid
Methods
Constructor DOMIT_Lite_Document (line 649)

DOM Document constructor

DOMIT_Lite_Document DOMIT_Lite_Document ()
appendChild (line 775)

Appends a node to the childNodes list of the current node

  • return: The appended node
Object &appendChild (Object &$node)
  • Object &$node: The node to be appended

Redefinition of:
DOMIT_Lite_ChildNodes_Interface::appendChild()
Appends a node to the childNodes list of the current node
appendEntityTranslationTable (line 1184)

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('&amp;' => '&');
cloneNode (line 1211)

Copies a node and/or its children

  • return: A copy of the 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_Lite_Node::cloneNode()
Copies a node and/or its children
createCDATASection (line 906)

Creates a new DOMIT_Lite_CDATASection node

  • return: The new CDATASection node
Object &createCDATASection (string $data)
  • string $data: The text of the CDATASection
createElement (line 882)

Creates a new DOMIT_Lite_Element node

  • return: The new element
Object &createElement (string $tagName)
  • string $tagName: The tag name of the element
createTextNode (line 894)

Creates a new DOMIT_Text node

  • return: The new text node
Object &createTextNode (string $data)
  • string $data: The text of the node
expandEmptyElementTags (line 738)

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)
getDocType (line 1126)

Returns the doctype text

  • return: The doctype text, or an emty string
string getDocType ()
getDOMImplementation (line 1150)

Returns a reference to the DOMIT_DOMImplementation object

  • return: A reference to the DOMIT_DOMImplementation object
Object &getDOMImplementation ()
getElementsByPath (line 934)

Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like expression.

  • return: A NodeList or single node that matches the pattern
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_Lite_Node::getElementsByPath()
Retrieves an element or DOMIT_NodeList of elements corresponding to an Xpath-like expression.
getElementsByTagName (line 918)

Retrieves a NodeList of child elements with the specified tag name

  • return: A NodeList of found elements
Object &getElementsByTagName (string $tagName)
  • string $tagName: The matching element tag name
getErrorCode (line 721)

Returns the error code from the underlying SAX parser

  • return: The error code
int getErrorCode ()
getErrorString (line 729)

Returns the error string from the underlying SAX parser

  • return: The error string
string getErrorString ()
getText (line 1112)

Returns the concatented text of the current node and its children

  • return: The concatented text of the current node and its children
string getText ()

Redefinition of:
DOMIT_Lite_Node::getText()
Returns the concatented text of the current node and its children
getTextFromFile (line 1025)

Retrieves text from a file

  • return: The text contained in the file
string getTextFromFile (string $filename)
  • string $filename: The file path
getVersion (line 1173)

Returns the current version of DOMIT! Lite

  • return: The current version of DOMIT! Lite
Object getVersion ()
getXMLDeclaration (line 1134)

Returns the xml declaration text

  • return: The xml declaration text, or an empty string
mixed getXMLDeclaration ()
insertBefore (line 837)

Inserts a node to the childNodes list of the current node

  • return: The inserted 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_Lite_ChildNodes_Interface::insertBefore()
Inserts a node to the childNodes list of the current node
load (line 1158)

Manages the firing of the onLoad() event

void load (Object &$contextNode)
  • Object &$contextNode: The parent node of the current recursion
loadXML (line 1015)

Parses an xml file

  • return: True if parsing is successful
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
loadXML_utf8 (line 1002)

Parses an xml file; first encodes text as UTF-8

  • return: True if parsing is successful
boolean loadXML_utf8 (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
parsedBy (line 1104)

Indicates the SAX parser used to parse the current document

  • return: Either "SAXY_LITE" or "EXPAT"
string parsedBy ()
parseXML (line 963)

Parses an xml string

  • return: True if parsing is successful
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
parseXML_utf8 (line 951)

Parses an xml string; first encodes string as UTF-8

  • return: True if parsing is successful
boolean parseXML_utf8 (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
removeChild (line 864)

Removes a node from the childNodes list of the current node

  • return: The removed node
Object &removeChild (Object &$oldChild)
  • Object &$oldChild: The node to be removed

Redefinition of:
DOMIT_Lite_ChildNodes_Interface::removeChild()
Removes a node from the childNodes list of the current node
replaceChild (line 801)

Replaces a node with another

  • return: The new node
Object &replaceChild (Object &$newChild, Object &$oldChild)
  • Object &$newChild: The new node
  • Object &$oldChild: The old node

Redefinition of:
DOMIT_Lite_ChildNodes_Interface::replaceChild()
Replaces a node with another
resolveErrors (line 665)

Specifies whether DOMIT! Lite will try to fix invalid XML before parsing begins

void resolveErrors (boolean $truthVal)
  • boolean $truthVal: True if errors are to be resolved
saveTextToFile (line 1088)

Saves text to a file

  • return: True if the save is successful
boolean saveTextToFile (string $filename, string $text)
  • string $filename: The file path
  • string $text: The text to be saved
saveXML (line 1069)

Saves the current DOM document as an xml file

  • return: True if save is successful
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
saveXML_utf8 (line 1052)

Saves the current DOM document as an xml file; first encodes text as UTF-8

  • return: True if save is successful
boolean saveXML_utf8 (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
setAuthorization (line 689)

Specifies basic authentication for an http connection

void setAuthorization (string $user, string $password)
  • string $user: The user name
  • string $password: The password
setConnection (line 678)

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
setDocumentElement (line 751)

Set the specified node as document element

  • return: The new document element
Object &setDocumentElement (Object &$node)
  • Object &$node: The node that is to become document element
setProxyAuthorization (line 713)

Specifies basic authentication for the proxy

void setProxyAuthorization (string $user, string $password)
  • string $user: The user name
  • string $password: The password
setProxyConnection (line 702)

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
setXMLDeclaration (line 1142)

Returns the xml declaration text

  • return: The xml declaration text, or an empty string
mixed setXMLDeclaration (mixed $decl)
toArray (line 1195)

Generates an array representation of the node and its children

  • return: A representation of the node and its children
Array toArray ()

Redefinition of:
DOMIT_Lite_Node::toArray()
Generates an array representation of the node and its children
toString (line 1233)

Generates a string representation of the node and its children

  • return: The string representation
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

Inherited Methods

Inherited From DOMIT_Lite_ChildNodes_Interface

DOMIT_Lite_ChildNodes_Interface::DOMIT_Lite_ChildNodes_Interface()
DOMIT_Lite_ChildNodes_Interface::appendChild()
DOMIT_Lite_ChildNodes_Interface::getElementsByAttribute()
DOMIT_Lite_ChildNodes_Interface::insertBefore()
DOMIT_Lite_ChildNodes_Interface::removeChild()
DOMIT_Lite_ChildNodes_Interface::replaceChild()
DOMIT_Lite_ChildNodes_Interface::_getElementsByAttribute()

Inherited From DOMIT_Lite_Node

DOMIT_Lite_Node::DOMIT_Lite_Node()
DOMIT_Lite_Node::appendChild()
DOMIT_Lite_Node::clearReferences()
DOMIT_Lite_Node::cloneNode()
DOMIT_Lite_Node::forHTML()
DOMIT_Lite_Node::getChildNodeIndex()
DOMIT_Lite_Node::getElementsByPath()
DOMIT_Lite_Node::getNamedElements()
DOMIT_Lite_Node::getText()
DOMIT_Lite_Node::hasChildNodes()
DOMIT_Lite_Node::insertBefore()
DOMIT_Lite_Node::nvl()
DOMIT_Lite_Node::onLoad()
DOMIT_Lite_Node::removeChild()
DOMIT_Lite_Node::replaceChild()
DOMIT_Lite_Node::setOwnerDocument()
DOMIT_Lite_Node::toArray()
DOMIT_Lite_Node::toNormalizedString()
DOMIT_Lite_Node::_constructor()

Documentation generated on Fri, 4 Mar 2005 13:57:38 +1000 by phpDocumentor 1.3.0RC3