Class: XML_XPath_common
Source Location: /XML_XPath-1.2.4/XPath/common.php
The XML_XPath_common class contains the DOM functions used to manipulate
Author(s):
Version:
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
appendChild [line 939]
object pointer appendChild(
mixed
$in_xmlData, [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Adds the node or document fragment to the end of the list of children. If the node is already in the tree it is first removed (not sure if this works yet)
Parameters:
appendData [line 868]
void appendData(
string
$in_content, [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Will append data to end of text node.
Parameters:
childNodes [line 205]
Retrieves the child nodes from the element node as an XML_XPath_result object Similar to an xpath query, this function will grab all the first descendant child nodes of the element node at the current position and will create an XML_XPath_result object of type nodeset with each of the child nodes as the nodes. DOM query functions do not take an xpathQuery argument
cloneNode [line 1072]
object cloned cloneNode(
[bool
$in_deep = false], [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Clones the node and return the node as a result object
Parameters:
deleteData [line 830]
void deleteData(
[int
$in_offset = 0], [int
$in_count = 0], [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Will delete data at offset and for count for a text node.
Parameters:
documentElement [line 253]
boolean documentElement(
[boolean
$in_movePointer = true])
|
|
Move to the document element
Parameters:
dumpChildren [line 1155]
string dumpChildren(
[string
$in_xpathQuery = null], [boolean
$in_movePointer = false], [
$in_format = true])
|
|
Returns all the contents of an element node, regardless of type, as is.
Parameters:
evaluate [line 1427]
mixed &evaluate(
string
$in_xpathQuery, [boolean
$in_movePointer = false])
|
|
Evaluate the xpath expression on the loaded xml document. The xpath query provided is evaluated and either an XML_XPath_result object is returned, or, if the pointer is being moved, it acts like a glorified step function and moves the pointer to the specified node (or first node if it is a set) and returns a boolean success
Parameters:
firstChild [line 423]
boolean firstChild(
[boolean
$in_movePointer = true])
|
|
Moves the pointer to the first child of this node or returns the first node. If the flag is on to skip blank nodes then the first non-blank node is used. Step functions do not take an xpathQuery argument
Parameters:
getAttribute [line 662]
string getAttribute(
string
$in_name, [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Retrieves an attribute value by name from the element node at the current pointer. Grab the attribute value if it exists and return it. If the attribute does not exist, this function will return the boolean 'false', so be sure to check properly if the value is "" or if the attribute doesn't exist at all. This function is the only attribute function which allows you to step onto the attribute node.
Parameters:
getAttributes [line 620]
array getAttributes(
[string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Return an associative array of attribute names as the keys and attribute values as the values. This is not a DOM function, but is a convenient addition.
Parameters:
getElementsByTagName [line 235]
Create an XML_XPath_result object with the elements with the specified tagname DOM query functions do not take an xpathQuery argument
Parameters:
getNodePath [line 1304]
string getNodePath(
$in_node, string
$in_xpathQuery, boolean
$in_movePointer)
|
|
Resolve the xpath location of the current node
Parameters:
getOne [line 1399]
mixed getOne(
string
$in_xpathQuery, [boolean
$in_movePointer = false])
|
|
A quick version of the evaluate, where the results are returned immediately. This function is equivalent to xsl:value-of select in every way.
Parameters:
getPointer [line 1260]
object current getPointer(
)
|
|
Get the current pointer in the xml document.
hasAttribute [line 588]
boolean hasAttribute(
string
$in_name, [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Returns true when an attribute with a given name is specified on this element false otherwise.
Parameters:
hasAttributes [line 555]
boolean hasAttributes(
[string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Returns whether this node has any attributes.
Parameters:
hasChildNodes [line 524]
boolean hasChildNodes(
[string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Returns whether this node has any children.
Parameters:
insertBefore [line 989]
object pointer insertBefore(
mixed
$in_xmlData, [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Inserts the node before the current pointer.
Parameters:
insertData [line 811]
void insertData(
string
$in_content, [int
$in_offset = 0], [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Will insert data at offset for a text node.
Parameters:
lastChild [line 474]
boolean lastChild(
[boolean
$in_movePointer = true])
|
|
Moves the pointer to the last child of this node or returns the last child. If the flag is on to skip blank nodes then the first non-blank node is used. Step functions do not take an xpathQuery argument
Parameters:
nextSibling [line 315]
boolean nextSibling(
[boolean
$in_movePointer = true])
|
|
Moves the internal pointer to the next sibling of the current node, or returns the pointer. If the flag is on to skip blank nodes then the first non-blank node is used. Step functions do not take an xpathQuery argument
Parameters:
nodeName [line 139]
string nodeName(
[string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Return the name of this node, depending on its type, according to the DOM recommendation
Parameters:
nodeType [line 170]
int nodeType(
[string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Returns the integer value constant corresponding to the DOM node type
Parameters:
parentNode [line 281]
boolean parentNode(
[boolean
$in_movePointer = true])
|
|
Moves the internal pointer to the parent of the current node or returns the pointer. Step functions do not take an xpathQuery argument
Parameters:
previousSibling [line 372]
boolean previousSibling(
[boolean
$in_movePointer = true])
|
|
Moves the internal pointer to the previous sibling of the current node or returns the pointer. If the flag is on to skip blank nodes then the first non-blank node is used. Step functions do not take an xpathQuery argument
Parameters:
removeAttribute [line 733]
boolean removeAttribute(
string
$in_name, [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Remove the attribute by name.
Parameters:
removeChild [line 1035]
object cloned removeChild(
[string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Removes the child node at the current pointer and returns it. This function will remove a child from the list of children and will move the pointer to the parent node.
Parameters:
replaceChild [line 888]
object pointer replaceChild(
mixed
$in_xmlData, [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Replaces the old child with the new child. If the new child is already in the document, it is first removed (not implemented yet). If the new child is a document fragment, then all of the nodes are inserted in the location of the old child.
Parameters:
replaceChildren [line 1106]
void replaceChildren(
$in_xmlData, [string
$in_xpathQuery = null], [boolean
$in_movePointer = false], string
$in_fragment)
|
|
Not in the DOM specification, but certainly a convenient function. Allows you to pass in an xml document fragment which will be parsed into an xml object and merged into the xml document, replacing all the previous children of the node. It does this by shallow cloning the node, restoring the attributes and then adding the parsed children.
Parameters:
replaceData [line 850]
void replaceData(
string
$in_content, [int
$in_offset = 0], [int
$in_count = 0], [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Will replace data at offset and for count with content
Parameters:
setAttribute [line 701]
boolean setAttribute(
string
$in_name, string
$in_value, [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Adds a new attribute. If an attribute with that name is already present in the element, its value is changed to be that of the value parameter. Invalid characters are escaped.
Parameters:
setPointer [line 1276]
void setPointer(
object
$in_node)
|
|
Set the pointer in the xml document
Parameters:
substringData [line 769]
string substringData(
[int
$in_offset = 0], [int
$in_count = 0], [string
$in_xpathQuery = null], [boolean
$in_movePointer = false])
|
|
Extracts a range of data from the node. Takes an offset and a count, which are optional and will default to retrieving the whole string. If an XML_ELEMENT_NODE provided, then it first concats all the adjacent text nodes recusively and works on those. ??? implement wholeText() which concats all text nodes adjacent to a text node ???
Parameters:
toFile [line 1187]
void toFile(
file
$in_file, [int
$in_compression = 0])
|
|
Exports the xml document to a file. Only works for the whole document right now.
Parameters:
toString [line 1222]
string toString(
[string
$in_xpathQuery = null], [boolean
$in_movePointer = false], [boolean
$in_format = true])
|
|
Export the xml document to a string, beginning from the pointer.
Parameters:
Documentation generated on Mon, 11 Mar 2019 14:44:42 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|