Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ext/dom: Add global registerNodeNS flag on DOMXPath ctor and property.
- Loading branch information
Showing
5 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--TEST-- | ||
Bug #55700 (XPath namespace prefix conflict, global registerNodeNS flag) | ||
--SKIPIF-- | ||
<?php require_once('skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
$doc = new DOMDocument(); | ||
$doc->loadXML('<prefix:root xmlns:prefix="urn:a" />'); | ||
|
||
$xp = new DOMXPath($doc, true); | ||
$xp->registerNamespace('prefix', 'urn:b'); | ||
|
||
echo($xp->query('//prefix:root')->length . "\n"); | ||
|
||
$xp = new DOMXPath($doc, false); | ||
$xp->registerNamespace('prefix', 'urn:b'); | ||
|
||
echo($xp->query('//prefix:root')->length . "\n"); | ||
|
||
var_dump($xp->registerNodeNamespaces); | ||
$xp->registerNodeNamespaces = true; | ||
|
||
var_dump($xp->registerNodeNamespaces); | ||
|
||
echo($xp->query('//prefix:root')->length . "\n"); | ||
|
||
var_dump($xp); | ||
?> | ||
--EXPECT-- | ||
1 | ||
0 | ||
bool(false) | ||
bool(true) | ||
1 | ||
object(DOMXPath)#4 (2) { | ||
["document"]=> | ||
string(22) "(object value omitted)" | ||
["registerNodeNamespaces"]=> | ||
bool(true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters