Return all nodes matching the given XPath query.
public findNodesRelativeTo ( string $query, $context ) : DOMNodeList | ||
$query | string | The query. |
return | DOMNodeList | The list of DOMNodes. |
/** * Return the list of files in this directory. * * @return array The list of files. */ public function getFiles() { $result = array(); foreach ($this->_xml->findNodesRelativeTo('./p:file', $this->getDirectoryNode()) as $file) { $name = $file->getAttribute('name'); $result[$name] = $this->_xml->createElementFile($name, $this); $result[$name]->setFileNode($file); } return $result; }
/** * Populate the existing file list from the XML. * * @param DOMNode $filelist The root node of the file list. * * @return NULL */ private function _populateFileList() { foreach ($this->_xml->findNodesRelativeTo('./p:install', $this->_filelist) as $file) { $this->_install_list['/' . $file->getAttribute('name')] = $file; } }