fixed path and changed to using an existing element

# manicdepressive at mindless dot com


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@163572 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Ken 2004-07-18 17:02:11 +00:00
parent 3415d5f66c
commit 50a9f9e59c

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<reference id="ref.simplexml">
<title>SimpleXML functions</title>
<titleabbrev>SimpleXML</titleabbrev>
@ -207,7 +207,7 @@ foreach ($xml->xpath('//character') as $character) {
include 'example.php';
$xml = simplexml_load_string($xmlstr);
$xml->movie[0]->actor[0]->age = '21';
$xml->movie[0]->characters->character[0]->name = 'Miss Coder';
echo $xml->asXML();
?>
@ -215,7 +215,7 @@ echo $xml->asXML();
</programlisting>
<simpara>
The above code will output a new XML document, just like the original,
except that the new XML will define Ms. Coder's age as 21.
except that the new XML will change Ms. Coder to Miss Coder.
</simpara>
</example>
</para>