本文整理汇总了PHP中TheSeer\fDOM\fDOMDocument::getElementsByTagName方法的典型用法代码示例。如果您正苦于以下问题:PHP fDOMDocument::getElementsByTagName方法的具体用法?PHP fDOMDocument::getElementsByTagName怎么用?PHP fDOMDocument::getElementsByTagName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TheSeer\fDOM\fDOMDocument
的用法示例。
在下文中一共展示了fDOMDocument::getElementsByTagName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCSSSelectorHonorsContextNode
public function testCSSSelectorHonorsContextNode()
{
$this->dom->load(__DIR__ . '/_data/selector.xml');
$ctx = $this->dom->getElementsByTagName('child')->item(0);
$result = $this->dom->select('child', $ctx);
$this->assertEquals(1, $result->length);
$this->assertEquals('child', $result->item(0)->nodeName);
$this->assertEquals('other', $result->item(0)->getAttribute('attr'));
}
示例2: load
/**
* @param string $filename
*
* @return Configuration
*/
public function load($filename)
{
$document = new fDOMDocument();
$document->load($filename);
$configuration = new Configuration($document->getElementsByTagName('directory')->item(0)->textContent, $document->getElementsByTagName('domain')->item(0)->textContent, $document->getElementsByTagName('email')->item(0)->textContent);
if ($document->getElementsByTagName('nginx')->item(0)) {
$configuration->setNginxConfigurationFile($document->getElementsByTagName('nginx')->item(0)->textContent);
}
foreach ($document->getElementsByTagName('series') as $series) {
/* @var fDOMElement $series */
$configuration->addAdditionalReleaseSeries($series->getAttribute('package'), $series->getAttribute('series'), $series->getAttribute('alias'));
}
return $configuration;
}
示例3: getMethods
/**
* @return MethodCollection
*/
public function getMethods()
{
$list = $this->document->getElementsByTagName('method');
return new MethodCollection($list, $this);
}