Class: XmlLib_Node
Source Location: /classes/xmllib.php
A generic implementation of a DOM node.
Author(s):
|
|
|
Class Details
Class Variables
Class Methods
constructor XmlLib_Node [line 102]
XmlLib_Node XmlLib_Node(
[string
$nodeName = 'node'], [int
$nodeType = 1])
|
|
Constructor
Tags:
Parameters:
method adopt [line 185]
method appendChild [line 195]
Assigns a node as child to current node
Parameters:
method childNodes [line 333]
void childNodes(
[mixed
$nodeName = null], [mixed
$nodeType = null])
|
|
Alias for children()
Tags:
method children [line 318]
array children(
[string
$nodeName = null], [string
$nodeType = null])
|
|
Fetch array of childnodes.
Tags:
Parameters:
method createCDATASection [line 159]
Creates a CDATASection node whose value is the specified string. The created node has no parent.
Parameters:
method createChild [line 119]
XmlLib_Node &createChild(
[string
$nodeName = null], [int
$nodeType = 1])
|
|
Constructs a child node, and returns it.
Parameters:
method createComment [line 172]
Creates a Comment node given the specified string. The created node has no parent.
Parameters:
method createElement [line 135]
Constructs a node, and returns it. The created node has no parent.
Parameters:
method createTextNode [line 146]
Creates a Text node given the specified string. The created node has no parent.
Parameters:
method dump [line 669]
void dump(
[string
$encoding = 'UTF-8'], [boolean
$sendHeaders = TRUE])
|
|
Outputs document to browser, complete with header Param encoding works with : but may work with other encodings too.
Parameters:
method escape [line 572]
string escape(
string
$str, string
$translation)
|
|
Escapes string with different protocols Allowed values for translation param are : - htmlentities
- htmlspecialchars
- addslashes
- flash_escape
Parameters:
method firstChild [line 277]
XmlLib_Node &firstChild(
[string
$nodeName = null], [mixed
$nodeType = null])
|
|
Fetch the first childnode, or null
Parameters:
method flash_escape [line 550]
string flash_escape(
string
$str)
|
|
Escape html-entities for flash For some reason flash doesn't seem to recognize the htmlentities for singlequote, lesser than and greater than
Parameters:
method getAttribute [line 458]
string getAttribute(
string
$name)
|
|
Retrieves the named attribute.
Parameters:
method getCardinality [line 358]
Finds the greatest used id + 1 (next free id)
method getElementById [line 342]
Iterates through the nodes children, looking for the first node with specified id.
method getElementsByNamespace [line 374]
array getElementsByNamespace(
mixed
$namespace)
|
|
method hasChildNodes [line 306]
This is a convenience method to allow easy determination of whether a node has any children.
Tags:
method hasChildren [line 296]
This is a convenience method to allow easy determination of whether a node has any children.
Tags:
method lastChild [line 258]
XmlLib_Node &lastChild(
[string
$nodeName = null], [mixed
$nodeType = null])
|
|
Fetch the last childnode, or null
Parameters:
method namespace [line 447]
Retrieves the namespace of the node
method nodeName [line 414]
Retrieves the name of the node
Tags:
method nodeNameNS [line 424]
Retrieves the name of the node with namespace if any
Tags:
method nodeType [line 438]
Retrieves the type of the node
method nodeValue [line 497]
Fetch the value of this node, depending on its type.
method parent [line 394]
If the returned value is null, the node is the topmost (root)
Tags:
method parentNode [line 403]
If the returned value is null, the node is the topmost (root)
method removeAttribute [line 483]
void removeAttribute(
string
$name)
|
|
Removes a named attribute
Parameters:
method removeChild [line 208]
Removes the child node indicated by oldChild from the list of children, and returns it.
Parameters:
method replaceChild [line 234]
Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If the newChild is already in the tree, it is first removed.
Tags:
Parameters:
method setAttribute [line 469]
bool setAttribute(
string
$name, string
$value)
|
|
Sets the value of the named attribute.
Parameters:
method setNodeValue [line 519]
void setNodeValue(
mixed
$value)
|
|
method toArray [line 715]
Translates the document into an associative array.
Parameters:
method toFile [line 687]
void toFile(
string
$filename, [string
$encoding = 'UTF-8'])
|
|
Writes document to file
Parameters:
method toHtml [line 705]
Makes a html decorated version of the document. Usefull for debugging.
Tags:
method toString [line 604]
string toString(
[bool
$add_formatting = false], [string
$att_escape = 'addslashes'], string
$str)
|
|
Recursively transforms node into string
Tags:
Parameters:
method unescape [line 589]
string unescape(
string
$str)
|
|
decodes c-style slashes and html-entities (unicode ones too)
Parameters:
|
|