Home
last modified time | relevance | path

Searched refs:xpath (Results 1 – 25 of 76) sorted by relevance

1234

/php-src/ext/dom/tests/
H A DDOMXPath_callables.phpt29 $xpath = new DOMXPath($doc);
30 $xpath->registerNamespace("php", "http://php.net/xpath");
39 $xpath->registerPHPFunctions(null);
45 $xpath = new DOMXPath($doc);
46 $xpath->registerNamespace("php", "http://php.net/xpath");
47 $xpath->registerPhpFunctions([]);
53 $xpath->evaluate("//a[php:function('xyz', string(@href))]");
63 $xpath = new MyDOMXPath($doc);
64 $xpath->registerNamespace("php", "http://php.net/xpath");
65 $xpath->registerCycle();
[all …]
H A Ddomxpath.phpt26 $xpath = new DOMXPath($dom);
28 $xpath->registerPHPFunctions('MyAverage');
29 $xpath->registerNamespace("php", "http://php.net/xpath");
31 $xpath->registerNamespace("def", "urn::default");
32 $nodelist = $xpath->query("//def:child");
37 $count = $xpath->evaluate("count(//def:child)");
41 $xpathdoc = $xpath->document;
51 $avg = $xpath->evaluate('number(php:function("MyAverage", //def:testnode))');
55 $xpath->registerPHPFunctions('non_existent');
56 $avg = $xpath->evaluate('number(php:function("non_existent", //def:testnode))');
[all …]
H A DDOMXPath_constructor_registered_functions.phpt7 if (!class_exists('DOMXPath')) die('skip no xpath support');
27 $xpath = new DOMXPath($dom);
28 $xpath->registerNamespace('foo', 'urn:foo');
29 $xpath->registerPhpFunctionNS('urn:foo', 'test', [new Test, 'test']);
33 $xpath->__construct($dom, true);
37 $xpath->registerNamespace('foo', 'urn:foo');
40 @$xpath->query('//*[foo:test()]');
41 $xpath->registerPhpFunctionNS('urn:foo', 'test', [new Test, 'test']);
42 $xpath->query('//*[foo:test()]');
H A DregisterPhpFunctionNS.phpt27 $xpath = new DOMXPath($doc);
29 $xpath->registerNamespace('foo', 'urn:foo');
33 $xpath->registerPhpFunctionNS('urn:foo', 'strtolower', strtolower(...));
38 $xpath->registerPhpFunctionNS('urn:foo', 'strtolower', 'strtolower');
44 var_dump($xpath->query('//a[foo:test(string(@href)) = "https://php.net"]'));
49 $xpath->registerPhpFunctionNS('urn:foo', 'test', $state->test(...));
50 var_dump($xpath->query('//a[foo:test(string(@href))]'));
55 $xpath->registerPhpFunctionNS('urn:foo', 'test', var_dump(...));
56 $xpath->query('//a[foo:test(string(@href))]');
60 $xpath->registerNamespace('bar', 'urn:bar');
[all …]
H A DregisterPhpFunctionNS_errors.phpt16 $xpath = new DOMXPath($doc);
19 $xpath->registerPhpFunctionNS('http://php.net/xpath', 'strtolower', strtolower(...));
25 $xpath->registerPhpFunctionNS('http://php.net/xpath', 'test', [new TrampolineClass, 'test']);
31 $xpath->registerPhpFunctionNS('urn:foo', '$$$', [new TrampolineClass, 'test']);
37 $xpath->registerPhpFunctionNS('urn:foo', 'x:a', strtolower(...));
43 $xpath->registerPhpFunctionNS("urn:foo", "\0", strtolower(...));
49 $xpath->registerPhpFunctionNS("\0", 'strtolower', strtolower(...));
56 DOMXPath::registerPhpFunctionNS(): Argument #1 ($namespaceURI) must not be "http://php.net/xpath" b…
57 DOMXPath::registerPhpFunctionNS(): Argument #1 ($namespaceURI) must not be "http://php.net/xpath" b…
H A Dgh11347.phpt2 GH-11347 (Memory leak when calling a static method inside an xpath query)
17 $xpath = new DOMXpath($doc);
18 $xpath->registerNamespace("php", "http://php.net/xpath");
19 $xpath->registerPHPFunctions();
20 $xpath->query("//a[php:function('MyClass::dump', string(@href))]");
H A DDOMXPath_evaluate_node_set_to_string.phpt16 $xpath = new DOMXPath($dom);
18 $xpath->registerNamespace("php", "http://php.net/xpath");
19 $xpath->registerPhpFunctions(['strrev']);
20 var_dump($xpath->evaluate('php:functionString("strrev", //p)'));
21 var_dump($xpath->evaluate('php:functionString("strrev", //namespace::*)'));
H A Dphp_function_edge_cases.phpt10 $xpath = new DOMXpath($doc);
11 $xpath->registerNamespace("php", "http://php.net/xpath");
12 $xpath->registerPHPFunctions();
14 $xpath->query("//a[php:function(3)]");
19 $xpath->query("//a[php:function()]");
H A DDOMXPath_evaluate_namespace_node_set.phpt16 $xpath = new DOMXPath($dom);
23 $xpath->registerNamespace("php", "http://php.net/xpath");
24 $xpath->registerPhpFunctions(['node_test']);
25 var_dump($xpath->evaluate('number(php:function("node_test", //namespace::*))'));
26 var_dump($xpath->evaluate('boolean(php:function("node_test", //namespace::*))'));
H A DDOMXPath_callables_errors.phpt11 $xpath = new DOMXPath($doc);
13 $xpath->registerPhpFunctions("nonexistent");
19 $xpath->registerPhpFunctions(function () {});
25 $xpath->registerPhpFunctions([function () {}]);
31 $xpath->registerPhpFunctions([var_dump(...)]);
37 $xpath->registerPhpFunctions(["nonexistent"]);
43 $xpath->registerPhpFunctions(["" => var_dump(...)]);
49 $xpath->registerPhpFunctions(["\0" => var_dump(...)]);
55 $xpath->registerPhpFunctions("");
H A Dgh12455.phpt16 $xpath = new DOMXPath($doc);
17 $xpath->registerNodeNamespaces = true;
18 $xpath->registerNamespace('b', 'http://test');
20 $elements = $xpath->query('//b:z');
25 $elements = $xpath->query('//*[name()="b:z"]');
H A Dbug75451.phpt2 Bug #75451 (Assertion fails while foreach on empty xpath query)
9 $xpath = new DOMXpath($dom);
10 foreach($xpath->query('/root/noexist') as $child) {
H A Dxpath_evaluate_basic_types.phpt10 $xpath = new DOMXpath($dom);
11 var_dump($xpath->evaluate("count(//p) > 0"));
12 var_dump($xpath->evaluate("string(//p/@align)"));
H A Dbug36756.phpt11 $xpath = new DOMXpath($dom);
12 $node = $xpath->query('/root')->item(0);
18 $xpath = new DOMXpath($dom);
19 $node = $xpath->query('//child')->item(0);
H A DDOMXPath_clone.phpt7 if (!class_exists('DOMXPath')) die('skip no xpath support');
13 $xpath = new DOMXPath($dom);
15 clone $xpath;
H A Dxpath_context_node.phpt19 $xpath = new DOMXpath($dom);
21 foreach ($xpath->query("p", $dom->documentElement->firstElementChild->nextElementSibling) as $p) {
25 var_dump($xpath->evaluate("count(p)", $dom->documentElement->firstElementChild->nextElementSibling)…
/php-src/ext/dom/tests/modern/html/parser/
H A DHTMLDocument_fromString_DOM_HTML_NO_DEFAULT_NS.phpt9 $xpath = new Dom\XPath($dom);
10 $xpath->registerNamespace("x", "http://www.w3.org/1999/xhtml");
11 var_dump($xpath->query("//p"));
12 var_dump($xpath->query("//x:p"));
15 $xpath = new Dom\XPath($dom);
16 $xpath->registerNamespace("x", "http://www.w3.org/1999/xhtml");
17 var_dump($xpath->query("//p"));
18 var_dump($xpath->query("//x:p"));
H A DHTMLDocument_fromFile_DOM_HTML_NO_DEFAULT_NS.phpt9 $xpath = new Dom\XPath($dom);
10 $xpath->registerNamespace("x", "http://www.w3.org/1999/xhtml");
11 var_dump($xpath->query("//p"));
12 var_dump($xpath->query("//x:p"));
15 $xpath = new Dom\XPath($dom);
16 $xpath->registerNamespace("x", "http://www.w3.org/1999/xhtml");
17 var_dump($xpath->query("//p"));
18 var_dump($xpath->query("//x:p"));
H A DHTMLDocument_fromString_line_column.phpt25 $xpath = new Dom\XPath($dom);
27 foreach ($xpath->query("//*") as $element) {
31 foreach ($xpath->query("//*[name()='strong']") as $element) {
35 foreach ($xpath->query("//*[name()='div']") as $element) {
41 foreach ($xpath->query("//comment()") as $comment) {
/php-src/ext/dom/tests/modern/xml/
H A Dxpath_query_context_in_scope_ns.phpt42 $xpath = new Dom\XPath($dom);
46 dump($xpath, '//b:bar', $c1);
47 dump($xpath, '//c:c1', $c1);
48 dump($xpath, '//c:c2', $c1);
49 dump($xpath, '//c:c3', $c1);
50 dump($xpath, '//c:c4', $c1);
51 dump($xpath, '//d:d', $c1);
52 dump($xpath, '//a', $c1);
56 dump($xpath, '//c:c1', $c2);
57 dump($xpath, '//c:c2', $c2);
[all …]
H A DXMLDocument_xpath.phpt19 $xpath = new Dom\XPath($dom);
23 $result = $xpath->query("//p");
27 $result = $xpath->evaluate("//p");
31 var_dump($xpath->evaluate("string(//p)"));
32 var_dump($xpath->evaluate("string-length(//p)"));
33 var_dump($xpath->evaluate("boolean(//p)"));
37 $result = $xpath->query("//*/comment()|//*/processing-instruction()");
47 var_dump($xpath->evaluate("//*/namespace::*"));
/php-src/ext/dom/tests/modern/spec/
H A Dbug81468.phpt16 $xpath = new Dom\XPath($dom);
17 $xpath->registerNamespace('n', 'some:namespace');
18 echo "/n:foo/bar -> ", count($xpath->query('/n:foo/bar')), "\n";
19 echo "/n:foo/n:bar -> ", count($xpath->query('/n:foo/n:bar')), "\n";
26 $xpath = new Dom\XPath($dom);
27 $xpath->registerNamespace('n', 'some:namespace');
28 echo "/n:foo/bar -> ", count($xpath->query('/n:foo/bar')), "\n";
29 echo "/n:foo/n:bar -> ", count($xpath->query('/n:foo/n:bar')), "\n";
/php-src/ext/simplexml/tests/
H A D008.phpt27 var_dump($sxe->xpath("elem1/elem2/elem3/elem4"));
29 var_dump($sxe->xpath("***"));
31 var_dump($sxe->xpath("**"));
45 Warning: SimpleXMLElement::xpath(): Invalid expression in %s on line %d%A
H A Dbug45553.phpt17 $atts = $x->xpath("/xml/data/@a:label");
19 $atts = $x->xpath("/xml/a:data");
21 $atts = $x->xpath("/xml/a:data/@a:label");
23 $atts = $x->xpath("/xml/a:data/@label");
25 $atts = $x->xpath("/xml/data/@label");
H A Dbug12170.phpt2 Bug GH-12170 (Can't use xpath with comments in SimpleXML)
20 $sxe->xpath('//bar')
23 foreach ($sxe->xpath('//comment()') as $comment) {

Completed in 39 milliseconds

1234