當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DOMXPath::__construct方法代碼示例

本文整理匯總了PHP中DOMXPath::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP DOMXPath::__construct方法的具體用法?PHP DOMXPath::__construct怎麽用?PHP DOMXPath::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DOMXPath的用法示例。


在下文中一共展示了DOMXPath::__construct方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct(DOMDocument $doc)
 {
     parent::__construct($doc);
     if (is_a($doc->documentElement, 'EPubDOMElement')) {
         foreach ($doc->documentElement->namespaces as $ns => $url) {
             $this->registerNamespace($ns, $url);
         }
     }
 }
開發者ID:seblucas,項目名稱:php-epub-meta,代碼行數:9,代碼來源:EPubDOMXPath.php

示例2: __construct

 public function __construct(Document $doc)
 {
     parent::__construct($doc);
     $this->doc = $doc;
     if ($doc->prefix) {
         $doc->xPath->registerNamespace('x', $doc->lookupNamespaceUri($doc->prefix));
     }
     $this->readyToCache();
 }
開發者ID:volux,項目名稱:dom,代碼行數:9,代碼來源:XPath.php

示例3: __construct

 /**
  * HHVM and some old PHP versions do not have a $document property by default
  * Add it is added if it was not found after executing parent constructor.
  *
  * @param \DOMDocument $dom
  */
 public function __construct(\DOMDocument $dom)
 {
     parent::__construct($dom);
     // store the document reference to avoid optimization to DOMDocument
     $this->_documentReference = $dom;
     // @codeCoverageIgnoreStart
     if (!isset($this->document)) {
         $this->document = $dom;
     }
     // @codeCoverageIgnoreEnd
 }
開發者ID:fluentdom,項目名稱:fluentdom,代碼行數:17,代碼來源:Xpath.php

示例4: __construct

 /**
  * Make instance of DOMXPath and register namespaces if required
  *
  * @param DOMDocument $doc DOMDocument to run DOMXPath over
  *
  * @return void
  *
  * @untranslatable null
  * @untranslatable namespace::*
  */
 public function __construct($doc)
 {
     parent::__construct($doc);
     $rootNamespace = $doc->lookupNamespaceUri($doc->namespaceURI);
     if ($rootNamespace !== null) {
         $prefix = $doc->lookupPrefix($doc->namespaceURI);
         $prefix = $prefix === null ? "null" : $prefix;
         $this->registerNamespace($prefix, $rootNamespace);
     }
     foreach ($this->query("namespace::*") as $node) {
         $prefix = $doc->lookupPrefix($node->nodeValue);
         if ($prefix !== null) {
             $this->registerNamespace($prefix, $node->nodeValue);
         }
     }
 }
開發者ID:kansey,項目名稱:statemachine,代碼行數:26,代碼來源:DOMXPathExtended.php

示例5: __construct

 /**
  * @param \DOMDocument $doc
  */
 public function __construct(\DOMDocument $doc)
 {
     parent::__construct($doc);
     $this->doc = $doc;
 }
開發者ID:klikar3,項目名稱:yii2-RGraph,代碼行數:8,代碼來源:fDOMXPath.php

示例6: __construct

 public function __construct(\DOMDocument $dom, $ns = array())
 {
     $this->dom = $dom;
     parent::__construct($dom);
     $this->registerNamespaces($ns);
 }
開發者ID:goetas,項目名稱:xmldom,代碼行數:6,代碼來源:XPath.php

示例7: __construct

 /**
  * DomXpath constructor.
  * @param DocumentWrapper $doc
  */
 public function __construct(DocumentWrapper $doc)
 {
     $this->documentWrapper = $doc;
     parent::__construct($doc->getDom());
 }
開發者ID:serp-spider,項目名稱:core,代碼行數:9,代碼來源:DomXpath.php


注:本文中的DOMXPath::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。