Class DOMIT_GetElementsByPath

Description

getElementsByPath is a simple utility for path-based access to nodes in a DOMIT! document.

Located in /includes/domit/xml_domit_getelementsbypath.php (line 27)


	
			
Variable Summary
Method Summary
DOMIT_GetElementsByPath DOMIT_GetElementsByPath ()
void determineSearchType (string $pattern)
Object &parsePattern (Object &$node, string $pattern, int $nodeIndex)
void selectNamedChild (Object &$node, int $pIndex)
void setContextNode ()
void splitPattern (string $pattern)
Variables
Object $abortSearch = false (line 41)
  • var: if true, the search will be aborted once the first match is found
array $arPathSegments = array() (line 35)
  • var: An array containing a series of path segments for which to search
Object $callingNode (line 29)
  • var: The node from which the search is called
Object $contextNode (line 33)
  • var: The node that is the current parent of the search
Object $nodeList (line 37)
  • var: A DOMIT_NodeList of matching nodes
int $searchType (line 31)
  • var: The type of search to be performed, i.e., relative, absolute, or variable
Object $targetIndex (line 39)
  • var: The index of the current node of the search
Methods
Constructor DOMIT_GetElementsByPath (line 46)

Constructor - creates an empty DOMIT_NodeList to store matching nodes

DOMIT_GetElementsByPath DOMIT_GetElementsByPath ()
determineSearchType (line 111)

Determines the type of search to be performed: absolute, relative, or variable

void determineSearchType (string $pattern)
  • string $pattern: The pattern
parsePattern (line 58)

Parses the supplied "path"-based pattern

  • return: The NodeList containing matching nodes
Object &parsePattern (Object &$node, string $pattern, int $nodeIndex)
  • Object &$node: The node from which the search is called
  • string $pattern: The pattern
  • int $nodeIndex: The node level of the current search
selectNamedChild (line 184)

Matches the current path segment against the child nodes of the current context node

void selectNamedChild (Object &$node, int $pIndex)
  • Object &$node: The context node
  • int $pIndex: The index in the arPathSegments array of the current path segment
setContextNode (line 136)

Sets the context node, i.e., the node from which the search begins

void setContextNode ()
splitPattern (line 161)

Splits the supplied pattern into searchable segments

void splitPattern (string $pattern)
  • string $pattern: The pattern

Documentation generated on Fri, 4 Mar 2005 13:57:35 +1000 by phpDocumentor 1.3.0RC3