Class DOMIT_GetElementsByPath
Retrieves an element or DOMIT_NodeList of elements corresponding to the specified "path"-like expression. Relative paths, absolute paths, and variable paths are allowed.

isPublic? no
isAbstract? no

Inheritance tree:

DOMIT_GetElementsByPath (top level class)

Known subclasses:

None

Source file: xml_domit_getelementsbypath.php




Constructor
Instantiates a new DOMIT_GetElementsByPath object.

Signature: DOMIT_GetElementsByPath()

isPublic? no




Public Constants



Private Constants
GET_ELEMENTS_BY_PATH_SEPARATOR
The "path" separator character.

Type: String

Value: /

GET_ELEMENTS_BY_PATH_SEARCH_ABSOLUTE
Search state for absolute paths (those starting with a single "/" character).

Type: int

Value: 0

GET_ELEMENTS_BY_PATH_SEARCH_RELATIVE
Search state for relative paths (those NOT starting with a "/" character).

Type: int

Value: 1

GET_ELEMENTS_BY_PATH_SEARCH_VARIABLE
Search state for variable paths (those starting with a "//").

Type: int

Value: 2




Public Fields



Private Fields
callingNode
A reference to the node from which DOMIT_GetElementsByPath was invoked.

Type: DOMIT_Node

searchType
An integer describing whether the pattern search is absolute, relative, or variable.

Type: int

startingPatternIndex
An integer describing which pattern segment the search should start at.

Type: int

contextNode
A reference to the node from which the search should begin.

Type: DOMIT_Node

arPathSegments
An array of strings describing the hierarchy of the element search.

Type: Array

arNodeList
The list of DOMIT_Elements to be returned.

Type: Array




Public Methods



Private Methods
parsePattern
Parses the supplied "path"-based pattern and returns an array of DOMIT_Elements, or a single DOMIT_Element.

Signature: &parsePattern(&$node, $pattern, $nodeIndex = 0)

Parameters:

DOMIT_Node node - The DOMIT_Node from which getElementsByPath was called.

String pattern - The pattern to evaluate.

int nodeIndex - The index of the element to be returned from the results array. If nodeIndex is 0, the entire array is returned.

Returns:

DOMIT_Node - The DOMIT_Node or a DOMIT_NodeList of DOMIT_Nodes which match the supplied "path" pattern.

determineSearchType
Determines whether the pattern search is relative, absolute, or variable.

Signature: determineSearchType($pattern)

Parameters:

String pattern - The "path"-based pattern to evaluate.

setContextNode
Sets the node from which the pattern search is to begin.

Signature: setContextNode()

splitPattern
Splits the supplied pattern into segments, based on the "/" separator.

Signature: splitPattern($pattern)

Parameters:

String pattern - The "path"-based pattern to evaluate.

selectNamedChild
Selects all children of the elements in arNodeList which have a nodeName of $name.

Signature: selectNamedChild($name)

Parameters:

String name - The element name to search for in the childNodes of the arNodeList elements.


Documentation generated by ClassyDoc, using the DOMIT! and SAXY parsers.
Please visit Engage Interactive to download free copies.