cvs: phpdoc /en/reference/simplexml/functions simplexml-element-getDocNamespaces.xml simplexml-element-getNamespaces.xml
simplexml-element-registerXPathNamespace.xml simplexml-load-file.xml simplexml-load-string.xml
| From: | Ben Ramsey | Date: | Thu, 22 Jun 2006 03:04:36 +0000 |
| Subject: | cvs: phpdoc /en/reference/simplexml/functions simplexml-element-getDocNamespaces.xml simplexml-element-getNamespaces.xml simplexml-element-registerXPathNamespace.xml simplexml-load-file.xml simplexml-load-string.xml |
||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969373361@lists.php.net to get a copy of this message | ||
ramsey Thu Jun 22 03:04:36 2006 UTC
Added files:
/phpdoc/en/reference/simplexml/functions
simplexml-element-registerXPathNamespace.xml
Modified files:
/phpdoc/en/reference/simplexml/functions
simplexml-element-getDocNamespaces.xml
simplexml-element-getNamespaces.xml
simplexml-load-file.xml
simplexml-load-string.xml
Log:
Added SimpleXML->registerXPathNamespace, and added ns and prefix parameters to
simplexml_load_file() and simplexml_load_string().
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml:1.6 phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml:1.7 --- phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml:1.6 Wed May 31 22:54:02 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml Thu Jun 22 03:04:35 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id='function.simplexml-element-getDocNamespaces'> <refnamediv> <refname>SimpleXMLElement->getDocNamespaces()</refname> @@ -107,6 +107,7 @@ <para> <simplelist> <member><xref linkend="function.simplexml-element-getNamespaces" /></member> + <member><xref linkend="function.simplexml-element-registerXPathNamespace" /></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml:1.6 phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml:1.7 --- phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml:1.6 Wed May 31 22:54:02 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml Thu Jun 22 03:04:35 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id='function.simplexml-element-getNamespaces'> <refnamediv> <refname>SimpleXMLElement->getNamespaces()</refname> @@ -89,6 +89,7 @@ <para> <simplelist> <member><xref linkend="function.simplexml-element-getDocNamespaces" /></member> + <member><xref linkend="function.simplexml-element-registerXPathNamespace" /></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml:1.13 phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml:1.14 --- phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml:1.13 Thu Jun 1 08:50:16 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml Thu Jun 22 03:04:35 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <refentry id='function.simplexml-load-file'> <refnamediv> <refname>simplexml_load_file</refname> @@ -14,6 +14,8 @@ <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>ns</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_prefix</parameter></methodparam> </methodsynopsis> <para> This function will convert the well-formed XML document in the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml:1.10 phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml:1.11 --- phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml:1.10 Wed May 31 22:54:02 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml Thu Jun 22 03:04:35 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry id='function.simplexml-load-string'> <refnamediv> <refname>simplexml_load_string</refname> @@ -14,6 +14,8 @@ <methodparam><type>string</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>ns</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_prefix</parameter></methodparam> </methodsynopsis> <para> This function will take the well-formed xml string http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-registerXPathNamespace.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/simplexml/functions/simplexml-element-registerXPathNamespace.xml +++ phpdoc/en/reference/simplexml/functions/simplexml-element-registerXPathNamespace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.simplexml-element-registerXPathNamespace'> <refnamediv> <refname>SimpleXMLElement->registerXPathNamespace()</refname> <refpurpose> Creates a prefix/ns context for the next XPath query </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SimpleXMLElement</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>registerXPathNamespace</methodname> <methodparam><type>string</type><parameter>prefix</parameter></methodparam> <methodparam><type>string</type><parameter>ns</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Creates a prefix/ns context for the next XPath query. In particular, this is helpful if the provider of the given XML document alters the namespace prefixes. <literal>registerXPathNamespace</literal> will create a prefix for the associated namespace, allowing one to access nodes in that namespace without the need to change code to allow for the new prefixes dictated by the provider. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>prefix</parameter></term> <listitem> <para> The namespace prefix to use in the XPath query for the namespace given in <parameter>ns</parameter>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>ns</parameter></term> <listitem> <para> The namespace to use for the XPath query. This must match a namespace in use by the XML document or the XPath query using <parameter>prefix</parameter> will not return any results. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Setting a namespace prefix to use in an XPath query</title> <programlisting role="php"> <![CDATA[ <?php $xml = <<<EOD <book xmlns:chap="http://example.org/chapter-title"> <title>My Book</title> <chapter id="1"> <chap:title>Chapter 1</chap:title> <para>Donec velit. Nullam eget tellus vitae tortor gravida scelerisque. In orci lorem, cursus imperdiet, ultricies non, hendrerit et, orci. Nulla facilisi. Nullam velit nisl, laoreet id, condimentum ut, ultricies id, mauris.</para> </chapter> <chapter id="2"> <chap:title>Chapter 2</chap:title> <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin gravida. Phasellus tincidunt massa vel urna. Proin adipiscing quam vitae odio. Sed dictum. Ut tincidunt lorem ac lorem. Duis eros tellus, pharetra id, faucibus eu, dapibus dictum, odio.</para> </chapter> </book> EOD; $sxe = new SimpleXMLElement($xml); $sxe->registerXPathNamespace('c', 'http://example.org/chapter-title'); $result = $sxe->xpath('//c:title'); foreach ($result as $title) { echo $title . "\n"; } ?> ]]> </programlisting> <para> Notice how the XML document shown in the example sets a namespace with a prefix of <literal>chap</literal>. Imagine that this document (or another one like it) may have used a prefix of <literal>c</literal> in the past for the same namespace. Since it has changed, the XPath query will no longer return the proper results and the query will require modification. Using <literal>registerXPathNamespace</literal> avoids future modification of the query even if the provider changes the namespace prefix. </para> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><xref linkend="function.simplexml-element-getDocNamespaces" /></member> <member><xref linkend="function.simplexml-element-getNamespaces" /></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml:1.6 phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml:1.7 --- phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml:1.6 Wed May 31 22:54:02 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml Thu Jun 22 03:04:35 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id='function.simplexml-element-getDocNamespaces'> <refnamediv> <refname>SimpleXMLElement->getDocNamespaces()</refname> @@ -107,6 +107,7 @@ <para> <simplelist> <member><xref linkend="function.simplexml-element-getNamespaces" /></member> + <member><xref linkend="function.simplexml-element-registerXPathNamespace" /></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml:1.6 phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml:1.7 --- phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml:1.6 Wed May 31 22:54:02 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml Thu Jun 22 03:04:35 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id='function.simplexml-element-getNamespaces'> <refnamediv> <refname>SimpleXMLElement->getNamespaces()</refname> @@ -89,6 +89,7 @@ <para> <simplelist> <member><xref linkend="function.simplexml-element-getDocNamespaces" /></member> + <member><xref linkend="function.simplexml-element-registerXPathNamespace" /></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml:1.13 phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml:1.14 --- phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml:1.13 Thu Jun 1 08:50:16 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml Thu Jun 22 03:04:35 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <refentry id='function.simplexml-load-file'> <refnamediv> <refname>simplexml_load_file</refname> @@ -14,6 +14,8 @@ <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>ns</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_prefix</parameter></methodparam> </methodsynopsis> <para> This function will convert the well-formed XML document in the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml:1.10 phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml:1.11 --- phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml:1.10 Wed May 31 22:54:02 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml Thu Jun 22 03:04:35 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry id='function.simplexml-load-string'> <refnamediv> <refname>simplexml_load_string</refname> @@ -14,6 +14,8 @@ <methodparam><type>string</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>ns</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_prefix</parameter></methodparam> </methodsynopsis> <para> This function will take the well-formed xml string http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-registerXPathNamespace.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/simplexml/functions/simplexml-element-registerXPathNamespace.xml +++ phpdoc/en/reference/simplexml/functions/simplexml-element-registerXPathNamespace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.simplexml-element-registerXPathNamespace'> <refnamediv> <refname>SimpleXMLElement->registerXPathNamespace()</refname> <refpurpose> Creates a prefix/ns context for the next XPath query </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SimpleXMLElement</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>registerXPathNamespace</methodname> <methodparam><type>string</type><parameter>prefix</parameter></methodparam> <methodparam><type>string</type><parameter>ns</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Creates a prefix/ns context for the next XPath query. In particular, this is helpful if the provider of the given XML document alters the namespace prefixes. <literal>registerXPathNamespace</literal> will create a prefix for the associated namespace, allowing one to access nodes in that namespace without the need to change code to allow for the new prefixes dictated by the provider. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>prefix</parameter></term> <listitem> <para> The namespace prefix to use in the XPath query for the namespace given in <parameter>ns</parameter>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>ns</parameter></term> <listitem> <para> The namespace to use for the XPath query. This must match a namespace in use by the XML document or the XPath query using <parameter>prefix</parameter> will not return any results. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Setting a namespace prefix to use in an XPath query</title> <programlisting role="php"> <![CDATA[ <?php $xml = <<<EOD <book xmlns:chap="http://example.org/chapter-title"> <title>My Book</title> <chapter id="1"> <chap:title>Chapter 1</chap:title> <para>Donec velit. Nullam eget tellus vitae tortor gravida scelerisque. In orci lorem, cursus imperdiet, ultricies non, hendrerit et, orci. Nulla facilisi. Nullam velit nisl, laoreet id, condimentum ut, ultricies id, mauris.</para> </chapter> <chapter id="2"> <chap:title>Chapter 2</chap:title> <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin gravida. Phasellus tincidunt massa vel urna. Proin adipiscing quam vitae odio. Sed dictum. Ut tincidunt lorem ac lorem. Duis eros tellus, pharetra id, faucibus eu, dapibus dictum, odio.</para> </chapter> </book> EOD; $sxe = new SimpleXMLElement($xml); $sxe->registerXPathNamespace('c', 'http://example.org/chapter-title'); $result = $sxe->xpath('//c:title'); foreach ($result as $title) { echo $title . "\n"; } ?> ]]> </programlisting> <para> Notice how the XML document shown in the example sets a namespace with a prefix of <literal>chap</literal>. Imagine that this document (or another one like it) may have used a prefix of <literal>c</literal> in the past for the same namespace. Since it has changed, the XPath query will no longer return the proper results and the query will require modification. Using <literal>registerXPathNamespace</literal> avoids future modification of the query even if the provider changes the namespace prefix. </para> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><xref linkend="function.simplexml-element-getDocNamespaces" /></member> <member><xref linkend="function.simplexml-element-getNamespaces" /></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->