Get all nodes matching an XPath query.

@param string $path
@return QuiteSimpleXMLElement[]
964544
public function xpath($path)
    {
        return array_map(function ($el) {
            return new QuiteSimpleXMLElement($el, $this);
        }, $this->el->xpath($path));
    }
706190
public function loadNode($path) {
        $list = @$this->zookeeper->getChildren($path);
        if(!empty($list)) {
            $data = [];
            foreach($list as $key) {
                $value = $this->zookeeper->get($path . '/' . $key);
                if(!empty($value)) {
                    $data[$key] = $value;
                }else {
                    $data[$key] = $this->loadNode($path . '/' . $key);
                }
            }
            return $data;
        }else {
            $value = @$this->zookeeper->get($path);
            return $value;
        }
    }
119977
protected function _getContents($path) {
		return ($res = $this->query(sprintf('SELECT content FROM %s WHERE id=%d', $this->tbf, $path))) && ($r = $res->fetch_assoc()) ? $r['content'] : false;
	}
73431
protected function getPhpFiles($path)
    {
        if (is_dir($path)) {
            return new RegexIterator(
                new RecursiveIteratorIterator(
                    new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
                    RecursiveIteratorIterator::SELF_FIRST,
                    RecursiveIteratorIterator::CATCH_GET_CHILD // Ignore "Permission denied"
                ),
                '/^.+\.php$/i',
                RecursiveRegexIterator::GET_MATCH
            );
        }
        else {
            return [];
        }
    }
651119
public function children($path = "")
  {
    if ($path) {
      $parts = $this->split($path);
      $name = array_shift($parts);

      $children = array();
      if (isset($this->_subTrees[$name])) {
        $subtree = $this->_subTrees[$name];
        /* @var $subtree Wrapper_FS_Changes */
        $this->_appendChildren(
          $children, $name, $subtree->children($parts)
        );
      }
    } else {
      $children = $this->own();
      foreach ($this->_subTrees as $name => $subtree) {
        /* @var $subtree Wrapper_FS_Changes */
        $this->_appendChildren(
          $children, $name, $subtree->children()
        );
      }
    }

    return $children;
  }
400836
public function xpath($path)
    {
        if ($path === '') {
            return clone $this;
        }
        $query = $this->_document->getQuery();

        $nodes = [];
        foreach ($this->_nodes as $node) {
            /**
             * @var \DOMNode $node2
             */
            foreach ($query->xpath($path, $node) as $node2) {
                $nodes[$node2->getNodePath()] = $node2;
            }
        }

        return new SelectorList($this, array_values($nodes));
    }
468953
public function items($path) {
		if($this->xpath === null)
			return array();
		$r = array();
		$nodes = $this->xpath->evaluate($path);
		foreach($nodes as $n)
			$r[] = new Node($n);
		return $r;
	}
1345790
protected function getSegments(string $path): array
    {
        if ('' !== $path && '/' === $path[0]) {
            $path = substr($path, 1);
        }

        return explode('/', $path);
    }
545384
protected function loadMeta($path, \DOMNode $context = null)
    {
        $result = [];

        /** @var \DOMElement $node */
        foreach ($this->xpath->query($path, $context) as $node) {
            $attribute = $node->tagName;
            $lang = $this->xpath->query('@lang', $node)->item(0)->nodeValue;

            if (!isset($result[$node->tagName])) {
                $result[$attribute] = [];
            }
            $result[$attribute][$lang] = $node->textContent;
        }

        return $result;
    }
411308
public static function replaceRelativePathElements($path)
    {
        $pathSegments = explode('/', $path);
        $absolutePath = '';
        foreach ($pathSegments as $pathSegment) {
            switch ($pathSegment) {
                case '.':
                    continue 2;
                break;
                case '..':
                    $absolutePath = NodePaths::getParentPath($absolutePath);
                break;
                default:
                    $absolutePath = NodePaths::addNodePathSegment($absolutePath, $pathSegment);
                break;
            }
        }

        return $absolutePath;
    }
920814
protected function getNode( $nodePath )
	{
		$pathNodes	= explode( "/", $nodePath );
		$xmlNode	=& $this->xmlTree;
		while( $pathNodes )
		{
			$pathNode	= trim( array_shift( $pathNodes ) );
			$matches	= array();
			if( preg_match_all( "@^(.*)\[([0-9]+)\]$@", $pathNode, $matches ) )
			{
				$pathNode	= $matches[1][0];
				$itemNumber	= $matches[2][0];
				$nodes		= $xmlNode->getChildren( $pathNode );
				if( !isset( $nodes[$itemNumber] ) )
					throw new InvalidArgumentException( 'Node not existing.' );
				$xmlNode	=& $nodes[$itemNumber];
				continue;
			}
			$xmlNode	=& $xmlNode->getChild( $pathNode );
			continue;
		}
		return $xmlNode;
	}
937109
public function getClassesByPath($path)
    {
        $allClasses = [];
        foreach ($this->findAllClasses([$this->rootPath."/$path"], 'php') as $class){
            $allClasses[] = trim($class,"0\\");
        }

        return $allClasses;
    }
414260
private function extractWebspaceFromPath($path)
    {
        $match = preg_match(
            sprintf(
                '/^\/%s\/([\w\.-]*?)\/.*$/',
                $this->pathSegmentRegistry->getPathSegment('base')
            ),
            $path,
            $matches
        );

        if ($match) {
            return $matches[1];
        }

        return;
    }
794163
public function xpath($path) {
    if ($path{0} === '/') {
      $this->rewind();
      if ($this->valid()) {
        return $this->current()->xpath($path);
      }
      return $this->_getEmptyElement();
    }

    return $this->_eachGetIterator('xpath', $path);
  }
1209888
public function getNode($path)
    {
        // init
        $chunks = $this->splitPath($path);

        // action
        $curObj = $this;
        foreach ($chunks as $chunk) {
            // check, if attributes exist
            $regs = array();
            preg_match('/^([a-z]+)(?:\[(.*)\])?$/i', $chunk, $regs);

            // if there are attributes, store them in array
            $chunkAttributes = array();
            if (sizeof($regs) > 2) {
                // get chunk name
                $chunk = $regs[1];

                // get attributes
                $tmpAttributes = preg_split('/\,/', $regs[2]);
                for ($i = 0; $i < sizeof($tmpAttributes); $i++) {
                    list($key, $value) = preg_split('/\=/', $tmpAttributes[$i]); // split into key = value
                    $key = substr($key, 1, strlen($key) - 1); // remove @
                    $value = trim($value, '\''); // remove ''
                    $chunkAttributes[$key] = $value; // add to attributes list
                }
            }

            if (($curObj = $curObj->getChildNode($chunk, $chunkAttributes)) != null) {
                // zuweisung schon oben in if-block schon erfolgt
            } else {
                throw new ChildDoesNotExistException('Child node "'.$chunk.'" '.' ("'.$path.'") does not exist.');
            }
        }

        // return
        return $curObj;
    }
640657
protected function getGlobPaths($path)
    {
        $paths = [];
        $iterator = new \GlobIterator($path);

        foreach ($iterator as $fileInfo) {
            /* @var $fileInfo \SplFileInfo */
            $paths[] = $fileInfo->getPathname();
        }

        // validate
        if (count($paths) === 0) {
            throw new InvalidConfigurationException("coverage_clover XML file is not readable: ${path}");
        }

        return $paths;
    }
755323
private function getCompiledViewPaths(string $path) : array
    {
        if (!is_dir($path)) {
            return [];
        }

        $files = [];
        $iter = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
            RecursiveIteratorIterator::SELF_FIRST,
            RecursiveIteratorIterator::CATCH_GET_CHILD
        );
        $iter->setMaxDepth(0);

        foreach ($iter as $path => $item) {
            if ($item->isFile()) {
                $files[] = $path;
            }
        }

        return $files;
    }