derick Fri Jan 30 18:38:06 2004 EDT
Modified files: /phpdoc/en/reference/simplexml reference.xml /phpdoc/en/reference/simplexml/functions simplexml-element-asXML.xml simplexml-element-children.xml simplexml-element-xpath.xml simplexml-load-dom.xml Log: - Minor corrections http://cvs.php.net/diff.php/phpdoc/en/reference/simplexml/reference.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc/en/reference/simplexml/reference.xml diff -u phpdoc/en/reference/simplexml/reference.xml:1.5 phpdoc/en/reference/simplexml/reference.xml:1.6 --- phpdoc/en/reference/simplexml/reference.xml:1.5 Thu Jan 29 04:40:45 2004 +++ phpdoc/en/reference/simplexml/reference.xml Fri Jan 30 18:38:05 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <reference id="ref.simplexml"> <title>SimpleXML functions</title> <titleabbrev>SimpleXML</titleabbrev> @@ -126,8 +126,8 @@ $xml = simplexml_load_string($xmlstr); /* Access the <rating> nodes of the first movie. - * Output the rating scale, too. */ -foreach($xml->movie[0]->rating as $rating) { + * Output the rating scale, too. */ +foreach ($xml->movie[0]->rating as $rating) { switch($rating['type']) { // Get attributes as element indices case 'thumbs': echo $rating, ' thumbs up'; @@ -144,9 +144,9 @@ </para> <para> <example> - <title>Using XPATH</title> + <title>Using Xpath</title> <simpara> - SimpleXML includes builtin <acronym>XPATH</acronym> support. + SimpleXML includes builtin <acronym>Xpath</acronym> support. To find all <literal><character></literal> elements: </simpara> <programlisting role="php"> @@ -200,20 +200,12 @@ and DOM formats. This example shows how one might change a DOM element to SimpleXML. </simpara> - <para> - <note> - <simpara> - This will only work with DOM in PHP 5, but SimpleXML wasn't - available before that version, so you should be fine. - </simpara> - </note> - </para> <programlisting role="php"> <![CDATA[ <?php $dom = new domDocument; $dom->loadXML('<books><book><title>blah</title></book></books>'); -if(!$dom) { +if (!$dom) { echo 'Error while parsing the document'; exit; } http://cvs.php.net/diff.php/phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml:1.1 phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml:1.2 --- phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml:1.1 Fri Jan 23 11:17:17 2004 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml Fri Jan 30 18:38:06 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id='function.simplexml-element-asXML'> <refnamediv> <refname>simplexml_element->asXML</refname> @@ -45,11 +45,11 @@ </example> </para> <para> - <literal>asXML</literal> also works on XPATH results: + <literal>asXML</literal> also works on Xpath results: <example> <title> Using asXML() on - <link linkend="function.simplexml-element-xpath">XPATH</link> + <link linkend="function.simplexml-element-xpath">Xpath</link> results </title> <programlisting role="php"> http://cvs.php.net/diff.php/phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml:1.2 phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml:1.3 --- phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml:1.2 Mon Jan 26 15:24:39 2004 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml Fri Jan 30 18:38:06 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id='function.simplexml-element-children'> <refnamediv> <refname>simplexml_element->children</refname> @@ -42,15 +42,15 @@ </child> </person>'); -foreach($xml->children() as $second_gen) { - echo ' The person begot a ',$second_gen['role']; +foreach ($xml->children() as $second_gen) { + echo ' The person begot a ' . $second_gen['role']; - foreach($second_gen->children() as $third_gen) { - echo ' who begot a ',$third_gen['role'],';'; + foreach ($second_gen->children() as $third_gen) { + echo ' who begot a ' . $third_gen['role'] . ';'; - foreach($third_gen->children() as $fourth_gen) { - echo ' and that ',$third_gen['role'], - ' begot a ',$fourth_gen['role']; + foreach ($third_gen->children() as $fourth_gen) { + echo ' and that ' . $third_gen['role'] . + ' begot a ' . $fourth_gen['role']; } } } http://cvs.php.net/diff.php/phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml:1.1 phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml:1.2 --- phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml:1.1 Fri Jan 23 11:17:17 2004 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml Fri Jan 30 18:38:06 2004 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id='function.simplexml-element-xpath'> <refnamediv> <refname>simplexml_element->xpath</refname> <refpurpose> - Runs XPATH query on XML data. + Runs Xpath query on XML data. </refpurpose> </refnamediv> <refsect1> @@ -15,12 +15,12 @@ </methodsynopsis> <para> The <literal>xpath</literal> method searches the SimpleXML node for - children matching the <acronym>XPATH</acronym> <parameter>path</parameter>. + children matching the <acronym>Xpath</acronym> <parameter>path</parameter>. It always returns an <type>array</type> of simplexml_element objects. </para> <para> <example> - <title>XPATH</title> + <title>Xpath</title> <programlisting role="php"> <![CDATA[ <?php http://cvs.php.net/diff.php/phpdoc/en/reference/simplexml/functions/simplexml-load-dom.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/simplexml/functions/simplexml-load-dom.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-load-dom.xml:1.2 phpdoc/en/reference/simplexml/functions/simplexml-load-dom.xml:1.3 --- phpdoc/en/reference/simplexml/functions/simplexml-load-dom.xml:1.2 Wed Jan 28 20:23:00 2004 +++ phpdoc/en/reference/simplexml/functions/simplexml-load-dom.xml Fri Jan 30 18:38:06 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id='function.simplexml-load-dom'> <refnamediv> <refname>simplexml_load_dom</refname> @@ -29,7 +29,7 @@ <?php $dom = new domDocument; $dom->loadXML('<books><book><title>blah</title></book></books>'); -if(!$dom) { +if (!$dom) { echo 'Error while parsing the document'; exit; }