findNodesRelativeTo() 공개 메소드

Return all nodes matching the given XPath query.
public findNodesRelativeTo ( string $query, $context ) : DOMNodeList
$query string The query.
리턴 DOMNodeList The list of DOMNodes.
예제 #1
0
파일: Directory.php 프로젝트: Gomez/horde
 /**
  * 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;
 }
예제 #2
0
파일: Contents.php 프로젝트: horde/horde
 /**
  * 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;
     }
 }