cvs: phpdoc /en/reference/simplexml reference.xml /en/reference/simplexml/functions simplexml-element-addAttribute.xml simplexml-element-addChild.xml
simplexml-element-asXML.xml simplexml-element-attributes.xml simplexml-element-children.xml simplexml-element-construct.xml
simplexml-element-getDocNamespaces.xml simplexml-element-getName.xml simplexml-element-getNamespaces.xml simplexml-element-xpath.xml
simplexml-load-file.xml simplexml-load-string.xml

From: Date: Wed, 31 May 2006 22:54:02 +0000
Subject: cvs: phpdoc /en/reference/simplexml reference.xml /en/reference/simplexml/functions simplexml-element-addAttribute.xml simplexml-element-addChild.xml
simplexml-element-asXML.xml simplexml-element-attributes.xml simplexml-element-children.xml simplexml-element-construct.xml
simplexml-element-getDocNamespaces.xml simplexml-element-getName.xml simplexml-element-getNamespaces.xml simplexml-element-xpath.xml
simplexml-load-file.xml simplexml-load-string.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969373152@lists.php.net to get a copy of this message
ramsey Wed May 31 22:54:02 2006 UTC Added files: /phpdoc/en/reference/simplexml/functions simplexml-element-construct.xml Modified files: /phpdoc/en/reference/simplexml reference.xml /phpdoc/en/reference/simplexml/functions simplexml-element-addAttribute.xml simplexml-element-addChild.xml simplexml-element-asXML.xml simplexml-element-attributes.xml simplexml-element-children.xml simplexml-element-getDocNamespaces.xml simplexml-element-getName.xml simplexml-element-getNamespaces.xml simplexml-element-xpath.xml simplexml-load-file.xml simplexml-load-string.xml Log: Added __construct() page for SimpleXML and modified examples to show usage of SimpleXML with SimpleXMLElement for a more OO approach.

http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/reference.xml?r1=1.17&r2=1.18&diff_format=u Index: phpdoc/en/reference/simplexml/reference.xml diff -u phpdoc/en/reference/simplexml/reference.xml:1.17 phpdoc/en/reference/simplexml/reference.xml:1.18 --- phpdoc/en/reference/simplexml/reference.xml:1.17 Sun Sep 4 19:39:28 2005 +++ phpdoc/en/reference/simplexml/reference.xml Wed May 31 22:54:02 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.17 $ --> +<!-- $Revision: 1.18 $ --> <!-- Purpose: xml --> <!-- Membership: bundled, external --> @@ -80,7 +80,7 @@ <?php include 'example.php'; -$xml = simplexml_load_string($xmlstr); +$xml = new SimpleXMLElement($xmlstr); echo $xml->movie[0]->plot; // "So this language. It's like..." ?> @@ -99,7 +99,7 @@ <?php include 'example.php'; -$xml = simplexml_load_string($xmlstr); +$xml = new SimpleXMLElement($xmlstr); /* For each <movie> node, we echo a separate <plot>. */ foreach ($xml->movie as $movie) { @@ -125,7 +125,7 @@ <?php include 'example.php'; -$xml = simplexml_load_string($xmlstr); +$xml = new SimpleXMLElement($xmlstr); /* Access the <rating> nodes of the first movie. * Output the rating scale, too. */ @@ -156,7 +156,7 @@ <?php include 'example.php'; -$xml = simplexml_load_string($xmlstr); +$xml = new SimpleXMLElement($xmlstr); if ((string) $xml->movie->title == 'PHP: Behind the Parser') { print 'My favorite movie.'; @@ -179,7 +179,7 @@ <![CDATA[ <?php include 'example.php'; -$xml = simplexml_load_string($xmlstr); +$xml = new SimpleXMLElement($xmlstr); foreach ($xml->xpath('//character') as $character) { echo $character->name, 'played by ', $character->actor, '<br />'; @@ -204,7 +204,7 @@ <![CDATA[ <?php include 'example.php'; -$xml = simplexml_load_string($xmlstr); +$xml = new SimpleXMLElement($xmlstr); $xml->movie[0]->characters->character[0]->name = 'Miss Coder'; @@ -220,6 +220,36 @@ </para> <para> <example> + <title>Adding elements and attributes</title> + <simpara> + Since PHP 5.1.3, SimpleXML has had the ability to easily add children and + attributes. + </simpara> + <programlisting role="php"> +<![CDATA[ +<?php +include 'example.php'; +$xml = new SimpleXMLElement($xmlstr); + +$character = $xml->movie[0]->characters->addChild('character'); +$character->addChild('name', 'Mr. Parser'); +$character->addChild('actor', 'John Doe'); + +$rating = $xml->movie[0]->addChild('rating', 'PG'); +$rating->addAttribute('type', 'mpaa'); + +echo $xml->asXML(); +?> +]]> + </programlisting> + <simpara> + The above code will output an XML document based on the original but + having a new character and rating. + </simpara> + </example> + </para> + <para> + <example> <title>DOM Interoperability</title> <simpara> PHP has a mechanism to convert XML nodes between SimpleXML http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-addAttribute.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-addAttribute.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-addAttribute.xml:1.4 phpdoc/en/reference/simplexml/functions/simplexml-element-addAttribute.xml:1.5 --- phpdoc/en/reference/simplexml/functions/simplexml-element-addAttribute.xml:1.4 Fri May 12 18:04:55 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-addAttribute.xml Wed May 31 22:54:02 2006 @@ -1,20 +1,23 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id='function.simplexml-element-addAttribute'> <refnamediv> - <refname>SimpleXMLElement->addAttribute</refname> + <refname>SimpleXMLElement->addAttribute()</refname> <refpurpose> Adds an attribute to the SimpleXML element </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; - <methodsynopsis> - <type>void</type><methodname>SimpleXMLElement->addAttribute</methodname> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - <methodparam><type>string</type><parameter>value</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>namespace</parameter></methodparam> - </methodsynopsis> + <classsynopsis> + <ooclass><classname>SimpleXMLElement</classname></ooclass> + <methodsynopsis> + <type>void</type><methodname>addAttribute</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + <methodparam><type>string</type><parameter>value</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>namespace</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> Adds an attribute to the SimpleXML element. </para> @@ -60,8 +63,10 @@ <programlisting role="php"> <![CDATA[ <?php + +include 'example.php'; -$sxe = new SimpleXMLElement($xmlstr); // or use simplexml_load_string() +$sxe = new SimpleXMLElement($xmlstr); $sxe->addAttribute('type', 'documentary'); $movie = $sxe->addChild('movie'); http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-addChild.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-addChild.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-addChild.xml:1.4 phpdoc/en/reference/simplexml/functions/simplexml-element-addChild.xml:1.5 --- phpdoc/en/reference/simplexml/functions/simplexml-element-addChild.xml:1.4 Fri May 12 18:04:55 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-addChild.xml Wed May 31 22:54:02 2006 @@ -1,20 +1,23 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id='function.simplexml-element-addChild'> <refnamediv> - <refname>SimpleXMLElement->addChild</refname> + <refname>SimpleXMLElement->addChild()</refname> <refpurpose> Adds a child element to the XML node </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; - <methodsynopsis> - <type>SimpleXMLElement</type><methodname>SimpleXMLElement->addChild</methodname> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>value</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>namespace</parameter></methodparam> - </methodsynopsis> + <classsynopsis> + <ooclass><classname>SimpleXMLElement</classname></ooclass> + <methodsynopsis> + <type>SimpleXMLElement</type><methodname>addChild</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>value</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>namespace</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> Adds a child element to the node and returns a SimpleXMLElement of the child. </para> @@ -68,8 +71,10 @@ <programlisting role="php"> <![CDATA[ <?php + +include 'example.php'; -$sxe = new SimpleXMLElement($xmlstr); // or use simplexml_load_string() +$sxe = new SimpleXMLElement($xmlstr); $sxe->addAttribute('type', 'documentary'); $movie = $sxe->addChild('movie'); http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml:1.5 phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml:1.6 --- phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml:1.5 Tue Sep 6 16:21:50 2005 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-asXML.xml Wed May 31 22:54:02 2006 @@ -1,18 +1,21 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id='function.simplexml-element-asXML'> <refnamediv> - <refname>SimpleXMLElement->asXML</refname> + <refname>SimpleXMLElement->asXML()</refname> <refpurpose> Return a well-formed XML string based on SimpleXML element </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; - <methodsynopsis> - <type>mixed</type><methodname>SimpleXMLElement->asXML</methodname> - <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> - </methodsynopsis> + <classsynopsis> + <ooclass><classname>SimpleXMLElement</classname></ooclass> + <methodsynopsis> + <type>mixed</type><methodname>asXML</methodname> + <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> The <literal>asXML</literal> method formats the parent object's data in XML version 1.0. @@ -66,7 +69,7 @@ </a> XML; -$xml = simplexml_load_string($string); +$xml = new SimpleXMLElement($string); echo $xml->asXML(); // <?xml ... <a><b><c>text</c><c>stuff</c> ... http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-attributes.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-attributes.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-attributes.xml:1.6 phpdoc/en/reference/simplexml/functions/simplexml-element-attributes.xml:1.7 --- phpdoc/en/reference/simplexml/functions/simplexml-element-attributes.xml:1.6 Fri Jun 24 14:55:15 2005 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-attributes.xml Wed May 31 22:54:02 2006 @@ -1,18 +1,22 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id='function.simplexml-element-attributes'> <refnamediv> - <refname>SimpleXMLElement->attributes</refname> + <refname>SimpleXMLElement->attributes()</refname> <refpurpose> Identifies an element's attributes </refpurpose> </refnamediv> <refsect1> <title>Description</title> - <methodsynopsis> - <type>SimpleXMLElement</type><methodname>simplexml_element->attributes</methodname> - <methodparam choice="opt"><type>string</type><parameter>data</parameter></methodparam> - </methodsynopsis> + <classsynopsis> + <ooclass><classname>SimpleXMLElement</classname></ooclass> + <methodsynopsis> + <type>SimpleXMLElement</type><methodname>attributes</methodname> + <methodparam choice="opt"><type>string</type><parameter>ns</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_prefix</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> This function provides the attributes and values defined within an xml tag. </para> http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml:1.8 phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml:1.9 --- phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml:1.8 Fri Jun 24 14:55:15 2005 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-children.xml Wed May 31 22:54:02 2006 @@ -1,18 +1,22 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <refentry id='function.simplexml-element-children'> <refnamediv> - <refname>SimpleXMLElement->children</refname> + <refname>SimpleXMLElement->children()</refname> <refpurpose> Finds children of given node </refpurpose> </refnamediv> <refsect1> <title>Description</title> - <methodsynopsis> - <type>SimpleXMLElement</type><methodname>simplexml_element->children</methodname> - <methodparam choice="opt"><type>string</type><parameter>nsprefix</parameter></methodparam> - </methodsynopsis> + <classsynopsis> + <ooclass><classname>SimpleXMLElement</classname></ooclass> + <methodsynopsis> + <type>SimpleXMLElement</type><methodname>children</methodname> + <methodparam choice="opt"><type>string</type><parameter>ns</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_prefix</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> This method finds the children of the element of which it is a member. The result follows normal iteration rules. @@ -23,7 +27,7 @@ <programlisting role="php"> <![CDATA[ <?php -$xml = simplexml_load_string( +$xml = new SimpleXMLElement( '<person> <child role="son"> <child role="daughter"/> http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml?r1=1.5&r2=1.6&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.5 phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml:1.6 --- phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml:1.5 Fri May 12 18:04:55 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-getDocNamespaces.xml Wed May 31 22:54:02 2006 @@ -1,18 +1,21 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id='function.simplexml-element-getDocNamespaces'> <refnamediv> - <refname>SimpleXMLElement->getDocNamespaces</refname> + <refname>SimpleXMLElement->getDocNamespaces()</refname> <refpurpose> Returns namespaces declared in document </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; - <methodsynopsis> - <type>array</type><methodname>SimpleXMLElement->getDocNamespaces</methodname> - <methodparam choice="opt"><type>bool</type><parameter>recursive</parameter></methodparam> - </methodsynopsis> + <classsynopsis> + <ooclass><classname>SimpleXMLElement</classname></ooclass> + <methodsynopsis> + <type>array</type><methodname>getDocNamespaces</methodname> + <methodparam choice="opt"><type>bool</type><parameter>recursive</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> Returns namespaces declared in document </para> @@ -60,7 +63,7 @@ </people> XML; -$sxe = new SimpleXMLElement($xml); // or use simplexml_load_string() +$sxe = new SimpleXMLElement($xml); $namespaces = $sxe->getDocNamespaces(); var_dump($namespaces); @@ -87,7 +90,7 @@ </people> XML; -$sxe = new SimpleXMLElement($xml); // or use simplexml_load_string() +$sxe = new SimpleXMLElement($xml); $namespaces = $sxe->getDocNamespaces(TRUE); var_dump($namespaces); http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-getName.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-getName.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-getName.xml:1.4 phpdoc/en/reference/simplexml/functions/simplexml-element-getName.xml:1.5 --- phpdoc/en/reference/simplexml/functions/simplexml-element-getName.xml:1.4 Fri May 12 18:04:55 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-getName.xml Wed May 31 22:54:02 2006 @@ -1,16 +1,19 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id='function.simplexml-element-getName'> <refnamediv> - <refname>SimpleXMLElement->getName</refname> + <refname>SimpleXMLElement->getName()</refname> <refpurpose>Gets the name of the XML element</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; - <methodsynopsis> - <type>string</type><methodname>SimpleXMLElement->getName</methodname> - <void/> - </methodsynopsis> + <classsynopsis> + <ooclass><classname>SimpleXMLElement</classname></ooclass> + <methodsynopsis> + <type>string</type><methodname>getName</methodname> + <void/> + </methodsynopsis> + </classsynopsis> <para> Gets the name of the XML element. </para> @@ -33,7 +36,7 @@ <![CDATA[ <?php -$sxe = new SimpleXMLElement($xmlstr); // or use simplexml_load_string() +$sxe = new SimpleXMLElement($xmlstr); echo $sxe->getName() . "\n"; http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml?r1=1.5&r2=1.6&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.5 phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml:1.6 --- phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml:1.5 Fri May 12 18:04:55 2006 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-getNamespaces.xml Wed May 31 22:54:02 2006 @@ -1,18 +1,21 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id='function.simplexml-element-getNamespaces'> <refnamediv> - <refname>SimpleXMLElement->getNamespaces</refname> + <refname>SimpleXMLElement->getNamespaces()</refname> <refpurpose> Returns namespaces used in document </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; - <methodsynopsis> - <type>array</type><methodname>SimpleXMLElement->getNamespaces</methodname> - <methodparam choice="opt"><type>bool</type><parameter>recursive</parameter></methodparam> - </methodsynopsis> + <classsynopsis> + <ooclass><classname>SimpleXMLElement</classname></ooclass> + <methodsynopsis> + <type>array</type><methodname>getNamespaces</methodname> + <methodparam choice="opt"><type>bool</type><parameter>recursive</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <para> Returns namespaces used in document </para> @@ -60,7 +63,7 @@ </people> XML; -$sxe = new SimpleXMLElement($xml); // or use simplexml_load_string() +$sxe = new SimpleXMLElement($xml); $namespaces = $sxe->getNamespaces(TRUE); var_dump($namespaces); http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml diff -u phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml:1.4 phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml:1.5 --- phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml:1.4 Fri Aug 20 09:37:00 2004 +++ phpdoc/en/reference/simplexml/functions/simplexml-element-xpath.xml Wed May 31 22:54:02 2006 @@ -1,21 +1,24 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id='function.simplexml-element-xpath'> <refnamediv> - <refname>SimpleXMLElement->xpath</refname> + <refname>SimpleXMLElement->xpath()</refname> <refpurpose> - Runs Xpath query on XML data + Runs XPath query on XML data </refpurpose> </refnamediv> <refsect1> <title>Description</title> - <methodsynopsis> - <type>array</type><methodname>SimpleXMLElement->xpath</methodname> - <methodparam><type>string</type><parameter>path</parameter></methodparam> - </methodsynopsis> + <classsynopsis> + <ooclass><classname>SimpleXMLElement</classname></ooclass> + <methodsynopsis> + <type>array</type><methodname>xpath</methodname> + <methodparam><type>string</type><parameter>path</parameter></methodparam> + </methodsynopsis> + </classsynopsis> <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 SimpleXMLElement objects. </para> <para> @@ -36,7 +39,7 @@ </a> XML; -$xml = simplexml_load_string($string); +$xml = new SimpleXMLElement($string); /* Search for <a><b><c> */ $result = $xml->xpath('/a/b/c'); http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml?r1=1.11&r2=1.12&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.11 phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml:1.12 --- phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml:1.11 Tue Sep 6 16:25:26 2005 +++ phpdoc/en/reference/simplexml/functions/simplexml-load-file.xml Wed May 31 22:54:02 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <refentry id='function.simplexml-load-file'> <refnamediv> <refname>simplexml_load_file</refname> @@ -79,8 +79,15 @@ </simpara> </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also: <function>simplexml_load_string</function> + <simplelist> + <member><xref linkend="function.simplexml-load-file" /></member> + <member><xref linkend="function.simplexml-element-construct" /></member> + </simplelist> </para> </refsect1> </refentry> http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml?r1=1.9&r2=1.10&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.9 phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml:1.10 --- phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml:1.9 Mon Feb 14 18:01:02 2005 +++ phpdoc/en/reference/simplexml/functions/simplexml-load-string.xml Wed May 31 22:54:02 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <refentry id='function.simplexml-load-string'> <refnamediv> <refname>simplexml_load_string</refname> @@ -77,8 +77,15 @@ </simpara> </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also: <function>simplexml_load_file</function>. + <simplelist> + <member><xref linkend="function.simplexml-load-file" /></member> + <member><xref linkend="function.simplexml-element-construct" /></member> + </simplelist> </para> </refsect1> </refentry> http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/simplexml/functions/simplexml-element-construct.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/simplexml/functions/simplexml-element-construct.xml +++ phpdoc/en/reference/simplexml/functions/simplexml-element-construct.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.simplexml-element-construct'> <refnamediv> <refname>SimpleXMLElement->__construct()</refname> <refpurpose> Creates a new SimpleXMLElement object </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SimpleXMLElement</classname></ooclass> <constructorsynopsis> <methodname>__construct</methodname> <methodparam><type>string</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>data_is_url</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>ns</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>is_prefix</parameter></methodparam> </constructorsynopsis> </classsynopsis> <para> Creates a new <classname>SimpleXMLElement</classname> object </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>data</parameter></term> <listitem> <para> A well-formed XML string or the path or URL to an XML document if <parameter>data_is_url</parameter> is &true;. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>options</parameter></term> <listitem> <para> Optionally used to specify <link linkend="libxml.constants">additional Libxml parameters</link>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>data_is_url</parameter></term> <listitem> <para> By default, <parameter>data_is_url</parameter> is &false;. Use &true; to specify that <parameter>data</parameter> is a path or URL to an XML document instead of <type>string</type> data. </para> </listitem> </varlistentry> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a <type>SimpleXMLElement</type> object representing <parameter>data</parameter>. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Create a SimpleXMLElement object</title> <programlisting role="php"> <![CDATA[ <?php include 'example.php'; $sxe = new SimpleXMLElement($xmlstr); echo $sxe->movie[0]->title; ?> ]]> </programlisting> </example> </para> <para> <example> <title>Create a SimpleXMLElement object from a URL</title> <programlisting role="php"> <![CDATA[ <?php $sxe = new SimpleXMLElement('http://example.org/document.xml', NULL, TRUE); echo $sxe->asXML(); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><xref linkend="function.simplexml-load-string" /></member> <member><xref linkend="function.simplexml-load-file" /></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 -->
« previous php.doc (#969373152) next »