didou Mon Sep 6 08:33:38 2004 EDT
Modified files: /phpdoc/en/reference/domxml/functions xpath-eval-expression.xml Log: add an example http://cvs.php.net/diff.php/phpdoc/en/reference/domxml/functions/xpath-eval-expression.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/domxml/functions/xpath-eval-expression.xml diff -u phpdoc/en/reference/domxml/functions/xpath-eval-expression.xml:1.3 phpdoc/en/reference/domxml/functions/xpath-eval-expression.xml:1.4 --- phpdoc/en/reference/domxml/functions/xpath-eval-expression.xml:1.3 Tue Apr 27 20:07:33 2004 +++ phpdoc/en/reference/domxml/functions/xpath-eval-expression.xml Mon Sep 6 08:33:38 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.29 --> <refentry id="function.xpath-eval-expression"> <refnamediv> @@ -11,11 +11,57 @@ <refsect1> <title>Description</title> <methodsynopsis> - <type>array</type><methodname>xpath_eval_expression</methodname> + <type>object</type><methodname>xpath_eval_expression</methodname> <methodparam><type>object</type><parameter>xpath_context</parameter></methodparam> + <methodparam><type>string</type><parameter>expression</parameter></methodparam> </methodsynopsis> &warn.experimental.func; <para> + <example> + <title><function>xpath_eval_expression</function> Example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$xpath = xpath_new_context($dom); +var_dump(xpath_eval_expression($xpath, '/chapter/@language')); + +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +object(XPathObject)(2) { + ["type"]=> + int(1) + ["nodeset"]=> + array(1) { + [0]=> + object(domattribute)(5) { + ["type"]=> + int(2) + ["name"]=> + string(8) "language" + ["value"]=> + string(2) "en" + [0]=> + int(7) + [1]=> + int(138004256) + } + } +} +]]> + </screen> + </example> </para> <para> See also <function>xpath_eval</function>.