当前位置: 首页>>代码示例>>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;未经允许,请勿转载。