Class: XMLDocQuery extends Parser
Properties
$doc
Set this to the current XMLDoc or XMLNode object.
$error = false
If an error occurs, this will contain the message.
$client
The XML-RPC client object.
$errno
The error number (faultCode) if an error occurs.
$name
Name of the node.
$value
Value of the attribute.
$version
XML version. Default is 1.0
$encoding
Encoding of the XML document. Default is 'utf-8'.
Please note: Actual encoding of data is not handled by these
classes.
$doctype
May contain the entire DOCTYPE declaration tag, including the
< and >.
$root
The root node of the XML document.
$filename
If this object was read in from a file, it may be specified here.
$xquery
If query() has been called, this will contain the XMLDocQuery object.
$content
Content of the node.
$children = array ()
Array of child node objects.
$attributes = array ()
Array of attribute objects.
$comment
Attach a comment to the node, which will appear as an XML comment
tag above the element.
$cdata = false
Notes whether the contents of this node should be displayed as
a <![CDATA[ ... ]]> block.
$number = 0
Contains the number of this node within its parent node. Numbers
only increase when more than one child has the same name.
$parent = false
Contains a reference to the parent of this node, or false if this
is the root node of the document.
$callbackStart = false
The function or method to use as a callback for the start tag
of the current XML node.
$callbackEnd = false
The function or method to use as a callback for the end tag
of the current XML node.
$callbackObject = false
The object that contains the methods listed in $callbackStart
and $callbackEnd (if they are methods and not ordinary custom or built-in
PHP functions).
$propagateCallback = false
Whether or not to propagate callback settings to new child
nodes upon their creation. Defaults to false.
$nodes = array ()
List of currently selected nodes.
$condition
If a condition token is found, this is set to an array containing
the 'operator' and the 'left' node set of the condition.
Return to Top
Methods
XMLDocQuery ()
Constructor method.
&query (&$rootNode, $query)
- Access: public
- Return: mixed
Executes a search against the XML tree structure using the
specified $query. Usually returns an array of matching nodes, either
XMLDocNode or XMLDocAttr objects, or a boolean value on conditional
queries.
queryFile ($file, $query)
- Access: public
- Return: mixed
Executes a search against the XML tree structure in the
specified $file, using the specified $query. Returns the output
of calling query() on the parsed file.
evalCond ($op, $one, $two)
- Access: public
- Return: boolean
Evaluates a condition specified by the $op operator,
and the two sides to compare.
evaluate (&$node, $struct)
- Access: public
- Return: boolean
Evaluates whether the current $node matches the
name and/or qualifications in $struct, which is created
by the various callback methods.
&getNodes (&$nodes, $name, $recursive = false)
- Access: public
- Return: array
Searches (optionally recursively) through the $nodes list,
calling evaluate() to determine whether each node matches the
current piece of the query (specified by $name).
_default ($token, $name)
The default callback method. Does nothing, and isn't normally
called.
_condition ($token, $name)
The condition operator handling callback method.
Initializes the $condition property.
_literal ($token, $name)
The literal number and string handling callback method.
_attribute ($token, $name, $regs)
The attribute handling callback method.
_nodeNum ($token, $name)
The numbered node handling callback method.
_nodeAttr ($token, $name)
The attribute-specified node handling callback method.
_node ($token, $name)
The ordinary node handling callback method.
Return to Top