mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
d04f48b6ac
ref: https://dom.spec.whatwg.org/#parent-element Closes GH-11679.
42 lines
871 B
PHP
42 lines
871 B
PHP
--TEST--
|
|
DOMXPath::query() can return DOMNodeList with DOMNameSpaceNode items
|
|
--EXTENSIONS--
|
|
dom
|
|
--FILE--
|
|
<?php
|
|
|
|
$xml = <<<'XML'
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<test></test>
|
|
XML;
|
|
$doc = new DomDocument;
|
|
$doc->loadXML($xml);
|
|
$xpath = new DOMXPath($doc);
|
|
$nodes = $xpath->query('//namespace::*');
|
|
var_dump($nodes->item(0));
|
|
|
|
?>
|
|
--EXPECT--
|
|
object(DOMNameSpaceNode)#4 (10) {
|
|
["nodeName"]=>
|
|
string(9) "xmlns:xml"
|
|
["nodeValue"]=>
|
|
string(36) "http://www.w3.org/XML/1998/namespace"
|
|
["nodeType"]=>
|
|
int(18)
|
|
["prefix"]=>
|
|
string(3) "xml"
|
|
["localName"]=>
|
|
string(3) "xml"
|
|
["namespaceURI"]=>
|
|
string(36) "http://www.w3.org/XML/1998/namespace"
|
|
["isConnected"]=>
|
|
bool(true)
|
|
["ownerDocument"]=>
|
|
string(22) "(object value omitted)"
|
|
["parentNode"]=>
|
|
string(22) "(object value omitted)"
|
|
["parentElement"]=>
|
|
string(22) "(object value omitted)"
|
|
}
|