Fix new style implementation

Add missing sections / parameters


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@227337 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mehdi Achour 2007-01-16 01:05:32 +00:00
parent e10a86f261
commit f7fd134d6c
11 changed files with 351 additions and 89 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id='function.simplexml-element-addAttribute'>
<refnamediv>
<refname>SimpleXMLElement->addAttribute()</refname>
@ -55,6 +55,13 @@
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<refentry id='function.simplexml-element-attributes'>
<refnamediv>
<refname>SimpleXMLElement->attributes()</refname>
<refpurpose>Identifies an element's attributes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>SimpleXMLElement</classname></ooclass>
<methodsynopsis>
@ -19,6 +20,40 @@
This function provides the attributes and values defined within an xml tag.
</para>
&simplexml.iteration;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
An optional namespace for the retrieved attributes
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>is_prefix</parameter></term>
<listitem>
<para>
Default to &false;
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Interpret an XML string</title>
@ -26,7 +61,7 @@
<![CDATA[
<?php
$string = <<<XML
<a>
<a xmlns:b>
<foo name="one" game="lonely">1</foo>
</a>
XML;
@ -38,9 +73,7 @@ foreach($xml->foo[0]->attributes() as $a => $b) {
?>
]]>
</programlisting>
<para>
This script will display:
</para>
&example.outputs;
<screen>
<![CDATA[
name="one"
@ -50,6 +83,7 @@ game="lonely"
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<refentry id='function.simplexml-element-children'>
<refnamediv>
<refname>SimpleXMLElement->children()</refname>
<refpurpose>Finds children of given node</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>SimpleXMLElement</classname></ooclass>
<methodsynopsis>
@ -20,9 +21,43 @@
follows normal iteration rules.
</para>
&simplexml.iteration;
<example>
<title>Traversing a <literal>children()</literal> pseudo-array</title>
<programlisting role="php">
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>is_prefix</parameter></term>
<listitem>
<para>
Default to &false;
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Traversing a <literal>children()</literal> pseudo-array</title>
<programlisting role="php">
<![CDATA[
<?php
$xml = new SimpleXMLElement(
@ -51,18 +86,18 @@ foreach ($xml->children() as $second_gen) {
}
?>
]]>
</programlisting>
<simpara>
This script will output:
</simpara>
<screen>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
The person begot a son who begot a daughter; The person
begot a daughter who begot a son; and that son begot a son
]]>
</screen>
</example>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<refentry id='function.simplexml-element-construct'>
<refnamediv>
<refname>SimpleXMLElement->__construct()</refname>
@ -21,7 +21,7 @@
</constructorsynopsis>
</classsynopsis>
<para>
Creates a new <classname>SimpleXMLElement</classname> object
Creates a new <classname>SimpleXMLElement</classname> object.
</para>
</refsect1>
@ -57,6 +57,20 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>is_prefix</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id='function.simplexml-element-getName'>
<refnamediv>
<refname>SimpleXMLElement->getName()</refname>
@ -51,6 +51,7 @@ foreach ($sxe->children() as $child)
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id='function.simplexml-element-getNamespaces'>
<refnamediv>
<refname>SimpleXMLElement->getNamespaces()</refname>
@ -65,13 +65,13 @@ XML;
$sxe = new SimpleXMLElement($xml);
$namespaces = $sxe->getNamespaces(TRUE);
$namespaces = $sxe->getNamespaces(true);
var_dump($namespaces);
?>
]]>
</programlisting>
&example.outputs.similar;
&example.outputs;
<screen>
<![CDATA[
array(1) {

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry id='function.simplexml-element-registerXPathNamespace'>
<refnamediv>
<refname>SimpleXMLElement->registerXPathNamespace()</refname>
@ -54,6 +54,13 @@
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
@ -88,8 +95,7 @@ $sxe = new SimpleXMLElement($xml);
$sxe->registerXPathNamespace('c', 'http://example.org/chapter-title');
$result = $sxe->xpath('//c:title');
foreach ($result as $title)
{
foreach ($result as $title) {
echo $title . "\n";
}

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry id='function.simplexml-element-xpath'>
<refnamediv>
<refname>SimpleXMLElement->xpath()</refname>
<refpurpose>Runs XPath query on XML data</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>SimpleXMLElement</classname></ooclass>
<methodsynopsis>
@ -17,8 +18,34 @@
<para>
The <literal>xpath</literal> method searches the SimpleXML node for
children matching the <acronym>XPath</acronym> <parameter>path</parameter>.
It always returns an <type>array</type> of SimpleXMLElement objects.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>path</parameter></term>
<listitem>
<para>
An XPath path
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Always returns an <type>array</type> of SimpleXMLElement objects.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Xpath</title>
@ -55,9 +82,7 @@ while(list( , $node) = each($result)) {
?>
]]>
</programlisting>
<para>
This script will display:
</para>
&example.outputs;
<screen>
<![CDATA[
/a/b/c: text

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id='function.simplexml-import-dom'>
<refnamediv>
<refname>simplexml_import_dom</refname>
@ -13,20 +13,55 @@
<methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam>
</methodsynopsis>
<para>
<!-- same with this link -->
This function takes a node of a <link linkend="ref.dom">DOM</link>
document and makes it into a SimpleXML node. This new object can
then be used as a native SimpleXML element. If any errors occur,
it returns &false;.
then be used as a native SimpleXML element.
</para>
<!-- php5 DOM isn't documented; this depends on it... :| -->
<!-- TODO: Document class_name and when it appeared. -->
<example>
<title>Import DOM</title>
<programlisting role="php">
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>node</parameter></term>
<listitem>
<para>
A <link linkend="ref.dom">DOM</link> Element node
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>class_name</parameter></term>
<listitem>
<para>
You may use this optional parameter so that
<function>simplexml_load_string</function> will return an object of
the specified class. That class should extend the
<type>SimpleXMLElement</type> class.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a <type>SimpleXMLElement</type> or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Importing DOM</title>
<programlisting role="php">
<![CDATA[
<?php
$dom = new domDocument;
$dom = new DOMDocument;
$dom->loadXML('<books><book><title>blah</title></book></books>');
if (!$dom) {
echo 'Error while parsing the document';
@ -38,13 +73,20 @@ $s = simplexml_import_dom($dom);
echo $s->book[0]->title; // blah
?>
]]>
</programlisting>
</example>
<para>
See also
<function>dom_import_simplexml</function>.
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>dom_import_simplexml</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<!-- $Revision: 1.16 $ -->
<refentry id='function.simplexml-load-file'>
<refnamediv>
<refname>simplexml_load_file</refname>
@ -18,32 +18,82 @@
<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
specified by <parameter>filename</parameter> to an <type>object</type>
of class <type>SimpleXMLElement</type>. If any errors occur during file
access or interpretation, the function returns &false;.
Convert the well-formed XML document in the given file to an object.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
You may use the optional <parameter>class_name</parameter> parameter so
that <function>simplexml_load_file</function> will return an object of
the specified class. That class should extend the
<type>SimpleXMLElement</type> class.
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
Path to the XML file
</para>
<note>
<para>
Libxml 2 unescapes the URI, so if you want to pass e.g.
<literal>b&amp;c</literal> as the URI parameter <literal>a</literal>,
you have to call
<literal>simplexml_load_file(rawurlencode('http://example.com/?a=' .
urlencode('b&amp;c')))</literal>. Since PHP 5.1.0 you don't need to do
this because PHP will do it for you.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>class_name</parameter></term>
<listitem>
<para>
You may use this optional parameter so that
<function>simplexml_load_string</function> will return an object of
the specified class. That class should extend the
<type>SimpleXMLElement</type> class.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
Since PHP 5.1.0 and Libxml 2.6.0, you may also use the
<parameter>options</parameter> parameter to specify <link
linkend="libxml.constants">additional Libxml parameters</link>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>is_prefix</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Since PHP 5.1.0 and Libxml 2.6.0, you may also use the
<parameter>options</parameter> parameter to specify <link
linkend="libxml.constants">additional Libxml parameters</link>.
Returns an <type>object</type> of class <type>SimpleXMLElement</type> with
properties containing the data held within the XML document. On errors, it
will return &false;.
</para>
<note>
<para>
Libxml 2 unescapes the URI, so if you want to pass e.g.
<literal>b&amp;c</literal> as the URI parameter <literal>a</literal>,
you have to call
<literal>simplexml_load_file(rawurlencode('http://example.com/?a=' .
urlencode('b&amp;c')))</literal>. Since PHP 5.1.0 you don't need to do
this because PHP will do it for you.
</para>
</note>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Interpret an XML document</title>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- $Revision: 1.13 $ -->
<refentry id='function.simplexml-load-string'>
<refnamediv>
<refname>simplexml_load_string</refname>
@ -18,22 +18,72 @@
<methodparam choice="opt"><type>bool</type><parameter>is_prefix</parameter></methodparam>
</methodsynopsis>
<para>
This function will take the well-formed xml string
<parameter>data</parameter> and return an <type>object</type> of class
<type>SimpleXMLElement</type> with properties containing the data held
within the xml document. If any errors occur, it returns &false;.
Takes a well-formed XML string and returns it as an object.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
You may use the optional <parameter>class_name</parameter> parameter so
that <function>simplexml_load_string</function> will return an object of
the specified class. That class should extend the
<type>SimpleXMLElement</type> class.
<variablelist>
<varlistentry>
<term><parameter>data</parameter></term>
<listitem>
<para>
A well-formed XML string
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>class_name</parameter></term>
<listitem>
<para>
You may use this optional parameter so that
<function>simplexml_load_string</function> will return an object of
the specified class. That class should extend the
<type>SimpleXMLElement</type> class.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
Since PHP 5.1.0 and Libxml 2.6.0, you may also use the
<parameter>options</parameter> parameter to specify <link
linkend="libxml.constants">additional Libxml parameters</link>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>is_prefix</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Since PHP 5.1.0 and Libxml 2.6.0, you may also use the
<parameter>options</parameter> parameter to specify <link
linkend="libxml.constants">additional Libxml parameters</link>.
Returns an <type>object</type> of class <type>SimpleXMLElement</type> with
properties containing the data held within the xml document. On errors, it
will return &false;.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Interpret an XML string</title>
@ -58,9 +108,7 @@ var_dump($xml);
?>
]]>
</programlisting>
<para>
This script will display:
</para>
&example.outputs;
<screen>
<![CDATA[
SimpleXMLElement Object