Documentation » API Reference

Application:

Class: XMLDocQuery extends Parser



Properties


$doc

  • Access: public

Set this to the current XMLDoc or XMLNode object.


$error false

  • Access: public

If an error occurs, this will contain the message.


$client

  • Access: public

The XML-RPC client object.


$errno

  • Access: public

The error number (faultCode) if an error occurs.


$name

  • Access: public

Name of the node.


$value

  • Access: public

Value of the attribute.


$version

  • Access: public

XML version. Default is 1.0


$encoding

  • Access: public

Encoding of the XML document. Default is 'utf-8'.
Please note: Actual encoding of data is not handled by these
classes.


$doctype

  • Access: public

May contain the entire DOCTYPE declaration tag, including the
< and >.


$root

  • Access: public

The root node of the XML document.


$filename

  • Access: public

If this object was read in from a file, it may be specified here.


$xquery

  • Access: public

If query() has been called, this will contain the XMLDocQuery object.


$content

  • Access: public

Content of the node.


$children = array ()

  • Access: public

Array of child node objects.


$attributes = array ()

  • Access: public

Array of attribute objects.


$comment

  • Access: public

Attach a comment to the node, which will appear as an XML comment
tag above the element.


$cdata false

  • Access: public

Notes whether the contents of this node should be displayed as
a <![CDATA[ ... ]]> block.


$number 0

  • Access: public

Contains the number of this node within its parent node. Numbers
only increase when more than one child has the same name.


$parent false

  • Access: public

Contains a reference to the parent of this node, or false if this
is the root node of the document.


$callbackStart false

  • Access: public

The function or method to use as a callback for the start tag
of the current XML node.


$callbackEnd false

  • Access: public

The function or method to use as a callback for the end tag
of the current XML node.


$callbackObject false

  • Access: public

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

  • Access: public

Whether or not to propagate callback settings to new child
nodes upon their creation. Defaults to false.


$nodes = array ()

  • Access: private

List of currently selected nodes.


$condition

  • Access: private

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 () 

  • Access: public

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

  • Access: private

The default callback method. Does nothing, and isn't normally
called.


_condition ($token$name

  • Access: private

The condition operator handling callback method.
Initializes the $condition property.


_literal ($token$name

  • Access: private

The literal number and string handling callback method.


_attribute ($token$name$regs

  • Access: private

The attribute handling callback method.


_nodeNum ($token$name

  • Access: private

The numbered node handling callback method.


_nodeAttr ($token$name

  • Access: private

The attribute-specified node handling callback method.


_node ($token$name

  • Access: private

The ordinary node handling callback method.

Return to Top