registerNamespace() public method

If the owner document is a FluentDOM\Document register the namespace on the document object, too.
public registerNamespace ( string $prefix, string $namespace ) : boolean
$prefix string
$namespace string
return boolean
コード例 #1
0
ファイル: Nodes.php プロジェクト: fluentdom/fluentdom
 /**
  * apply stored namespaces to attached document or xpath object
  */
 private function applyNamespaces()
 {
     $dom = $this->getDocument();
     if ($dom instanceof Document) {
         foreach ($this->_namespaces as $prefix => $namespace) {
             $dom->registerNamespace($prefix, $namespace);
         }
     } elseif (isset($this->_xpath)) {
         foreach ($this->_namespaces as $prefix => $namespace) {
             $this->_xpath->registerNamespace($prefix, $namespace);
         }
     }
 }