cvs: phpdoc-fr /reference/bcompiler/functions bcompiler-parse-class.xml bcompiler-read.xml /reference/domxml/functions DomAttribute-name.xml
DomAttribute-value.xml DomDocument-add-root.xml DomDocument-html-dump-mem.xml DomDocument-xinclude.xml DomDocumentType-name.xml
DomDocumentType-system-id.xml DomElement-get-attribute-node.xml DomElement-get-attribute.xml DomElement-has-attribute.xml DomElement-set-attribute.xml
DomElement-tagname.xml domxml-version.xml /reference/mcrypt reference.xml /reference/simplexml/functions simplexml-import-dom.xml
/reference/strings/functions stripslashes.xml
| From: | Yannick TORRES | Date: | Sun, 29 Aug 2004 21:47:36 +0000 |
| Subject: | cvs: phpdoc-fr /reference/bcompiler/functions bcompiler-parse-class.xml bcompiler-read.xml /reference/domxml/functions DomAttribute-name.xml DomAttribute-value.xml DomDocument-add-root.xml DomDocument-html-dump-mem.xml DomDocument-xinclude.xml DomDocumentType-name.xml DomDocumentType-system-id.xml DomElement-get-attribute-node.xml DomElement-get-attribute.xml DomElement-has-attribute.xml DomElement-set-attribute.xml DomElement-tagname.xml domxml-version.xml /reference/mcrypt reference.xml /reference/simplexml/functions simplexml-import-dom.xml /reference/strings/functions stripslashes.xml |
||
| Groups: | php.doc.fr | ||
| Request: | Send a blank email to doc-fr+get-3409@lists.php.net to get a copy of this message | ||
yannick Sun Aug 29 17:47:36 2004 EDT
Modified files:
/phpdoc-fr/reference/bcompiler/functions bcompiler-parse-class.xml
bcompiler-read.xml
/phpdoc-fr/reference/domxml/functions DomAttribute-name.xml
DomAttribute-value.xml
DomDocument-add-root.xml
DomDocument-html-dump-mem.xml
DomDocumentType-name.xml
DomDocumentType-system-id.xml
DomDocument-xinclude.xml
DomElement-get-attribute-node.xml
DomElement-get-attribute.xml
DomElement-has-attribute.xml
DomElement-set-attribute.xml
DomElement-tagname.xml
domxml-version.xml
/phpdoc-fr/reference/mcrypt reference.xml
/phpdoc-fr/reference/simplexml/functions simplexml-import-dom.xml
/phpdoc-fr/reference/strings/functions stripslashes.xml
Log:
synch with en
http://cvs.php.net/diff.php/phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml diff -u phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml:1.2 phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml:1.3 --- phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml:1.2 Thu Aug 19 11:11:30 2004 +++ phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml Sun Aug 29 17:47:36 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> - <refentry id="pecl.bcompiler.parse_class"> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> + <refentry id="function.bcompiler-parse-class"> <refnamediv> <refname>bcompiler_parse_class</refname> <refpurpose>Lit le bytecode d'une classe et revient à une fonction utilisateur</refpurpose> http://cvs.php.net/diff.php/phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml diff -u phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml:1.2 phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml:1.3 --- phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml:1.2 Thu Aug 19 11:11:30 2004 +++ phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml Sun Aug 29 17:47:36 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> - <refentry id="funcion.bcompiler-read"> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> + <refentry id="function.bcompiler-read"> <refnamediv> <refname>bcompiler_read</refname> <refpurpose>Lit et crée les classes depuis un descripteur de fichier</refpurpose> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml diff -u phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml:1.7 phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml:1.8 --- phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml:1.7 Tue Aug 10 18:04:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.domattribute-name"> <refnamediv> <refname>DomAttribute->name</refname> @@ -20,7 +20,7 @@ </para> <para> Voir aussi - <function>domattribute_value</function>. + <function>domattribute_value</function> pour un exemple. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml diff -u phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml:1.5 phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml:1.6 --- phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml:1.5 Tue Aug 10 16:32:56 2004 +++ phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.domattribute-value"> <refnamediv> <refname>DomAttribute->value</refname> @@ -17,6 +17,41 @@ <para> <methodname>DomAttribute->value</methodname> retourne la valeur de l'attribut. + </para> + <para> + <example> + <title>Récupération de tous les attributs d'un noeud</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +$root = $dom->document_element(); +$attrs = $root->attributes(); + +echo 'Attributs de ' . $root->node_name() . "\n"; +foreach ($attrs as $attribute) { + echo ' - ' . $attribute->name . ' : ' . $attribute->value . "\n"; +} + +?> + +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Attributs de chapter + - language : en +]]> + </screen> + </example> </para> <para> Voir aussi http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml:1.6 phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml:1.7 --- phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml:1.6 Tue Aug 10 18:04:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.domdocument-add-root"> <refnamediv> <refname>DomDocument->add_root</refname> @@ -9,7 +9,7 @@ <refsect1> <title>Description</title> <methodsynopsis> - <type>resource</type><methodname>DomDocument->add_root</methodname> + <type>object</type><methodname>DomDocument->add_root</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> &warn.experimental.func; @@ -26,9 +26,9 @@ <![CDATA[ <?php $doc = domxml_new_doc("1.0"); -$root = $doc->add_root("HTML"); -$head = $root->new_child("HEAD", ""); -$head->new_child("TITLE", "Voilà le titre"); +$root = $doc->add_root("html"); +$head = $root->new_child("head", ""); +$head->new_child("title", "Voilà le titre"); echo htmlentities($doc->dump_mem()); ?> ]]> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.4 phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.5 --- phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.4 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.domdocument-html-dump-mem"> <refnamediv> <refname>DomDocument->html_dump_mem</refname> @@ -26,21 +26,32 @@ <programlisting role="php"> <![CDATA[ <?php + +// Création du document $doc = domxml_new_doc("1.0"); -$root = $doc->create_element("HTML"); + +$root = $doc->create_element("html"); $root = $doc->append_child($root); -$head = $doc->create_element("HEAD"); + +$head = $doc->create_element("head"); $head = $root->append_child($head); -$title = $doc->create_element("TITLE"); + +$title = $doc->create_element("title"); $title = $head->append_child($title); -$text = $doc->create_text_node("This is the title"); + +$text = $doc->create_text_node("Ceci est le titre"); $text = $title->append_child($text); -echo "<pre>"; -echo htmlentities($doc->html_dump_mem()); -echo "</pre>"; + +echo $doc->html_dump_mem(); ?> ]]> </programlisting> + &example.outputs; + <screen role="xml"> +<![CDATA[ +<html><head><title>Ceci est le titre</title></head></html> +]]> + </screen> </example> </para> <para> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml:1.3 phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.domdocumenttype-name"> <refnamediv> <refname>DomDocumentType->name</refname> @@ -16,6 +16,28 @@ </methodsynopsis> <para> <function>DomDocumentType->name</function> retourne le nom du type de document. + </para> + <para> + <example> + <title>Récupération du nom du type du document</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur pendant l'analyse du document\n"; + exit; +} + +$doctype = $dom->doctype(); +echo $doctype->name(); // chapitre + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml:1.3 phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.domdocumenttype-system-id"> <refnamediv> <refname>DomDocumentType->system_id</refname> @@ -19,8 +19,6 @@ système du type de document. </para> <para> - L'exemple ci-dessous affichera - '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd'. <example> <title>Lire un identifiant système DOM XML</title> <programlisting role="php"> @@ -38,6 +36,12 @@ ?> ]]> </programlisting> + &example.outputs; + <screen> +<![CDATA[ +/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd +]]> + </screen> </example> </para> </refsect1> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml:1.4 phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml:1.5 --- phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml:1.4 Fri Aug 20 16:34:21 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml Sun Aug 29 17:47:36 2004 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.domdocument-xinclude"> <refnamediv> <refname>DomDocument->xinclude</refname> - <refpurpose>Remplace XIncludes dans un objet domdocument</refpurpose> + <refpurpose>Remplace XIncludes dans un objet DomDocument</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -13,8 +13,59 @@ <void/> </methodsynopsis> &warn.experimental.func; - &warn.undocumented.func; + <para> + <function>DomDocument->xinclude</function> substitue <literal>XIncludes</literal> + dans un objet DomDocument. + </para> + <para> + <example> + <title>Substitution</title> + <programlisting role="php"> +<![CDATA[ +<?php +// include.xml contient : +// <child>test</child> + +$xml = '<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:include href="include.xml"> + <xi:fallback> + <error>xinclude: include.xml n\'a pas été trouvé</error> + </xi:fallback> + </xi:include> +</root>'; + +$domxml = domxml_open_mem($xml); +$domxml->xinclude(); + +echo $domxml->dump_mem(); + +?> +]]> + </programlisting> + &example.outputs; + <screen role="xml"> +<![CDATA[ +<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <child>test</child> +</root> +]]> + </screen> + <para> + Si <filename>include.xml</filename> n'existe pas, vous verez : + </para> + <screen role="xml"> +<![CDATA[ +<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <error>xinclude:dom.xml n'a pas été trouvé</error> +</root> +]]> + </screen> + </example> + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml:1.3 phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.domelement-get-attribute-node"> <refnamediv> <refname>DomElement->get_attribute_node</refname> @@ -12,10 +12,39 @@ <title>Description</title> <methodsynopsis> <type>object</type><methodname>DomElement->get_attribute_node</methodname> - <methodparam><type>object</type><parameter>attr</parameter></methodparam> + <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + <methodname>DomElement->get_attribute_node</methodname> retourne + le noeud de l'attribut nommé <parameter>name</parameter> dans + l'élément courant. Le paramètre <parameter>name</parameter> est sensible à la casse. + </para> + <para> + Si aucun attribut portant le nom fourni n'est trouvé, &false; est retourné. + </para> + <para> + <example> + <title>Récupération d'un attribut d'un noeud</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +$root = $dom->document_element(); +if ($attribute = $root->get_attribute_node('language')) { + echo 'Le langage est : ' . $attribute->value() . "\n"; +} + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml:1.4 phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml:1.5 --- phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml:1.4 Wed Jun 16 17:08:31 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.domelement-get-attribute"> <refnamediv> <refname>DomElement->get_attribute</refname> @@ -11,7 +11,7 @@ <refsect1> <title>Description</title> <methodsynopsis> - <type>object</type><methodname>DomElement->get_attribute</methodname> + <type>string</type><methodname>DomElement->get_attribute</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> <para> @@ -21,6 +21,29 @@ <para> (&php; >= 4.3 uniquement) Si aucun attribut de nom <parameter>name</parameter> n'est trouvé, une chaîne vide est retournée. + </para> + <para> + <example> + <title>Récupération de la valeur d'un attribut</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +// get chapter +$root = $dom->document_element(); +echo $root->get_attribute('language')); // en + +?> +]]> + </programlisting> + </example> </para> <para> Voir aussi http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml:1.3 phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.domelement-has-attribute"> <refnamediv> <refname>DomElement->has_attribute</refname> @@ -13,7 +13,36 @@ <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + <methodname>DomElement->has_attribute</methodname> vérifie l'existence + d'un attribut nommé <parameter>name</parameter> dans le noeud courant. + </para> + <para> + <example> + <title>Test l'existence d'un attribut</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +$root = $dom->document_element(); + +$buffer = '<html' +if ($root->has_attribute('language')) { + $buffer .= 'lang="' . $root->get_attribute('language') . '"'; +} +$buffer .= '>'; + +?> + +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml:1.4 phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml:1.5 --- phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml:1.4 Mon Aug 9 13:04:02 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml Sun Aug 29 17:47:36 2004 @@ -1,17 +1,17 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.7 Maintainer: didou Status: ready --> <refentry id="function.domelement-set-attribute"> <refnamediv> <refname>DomElement->set_attribute</refname> <refpurpose> - Ajoute un nouvel attribut + Définie la valeur d'un attribut </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> - <type>bool</type><methodname>DomElement->set_attribute</methodname> + <type>object</type><methodname>DomElement->set_attribute</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> @@ -26,12 +26,10 @@ <programlisting role="php"> <![CDATA[ <?php - $doc = domxml_new_doc("1.0"); $node = $doc->create_element("para"); $newnode = $doc->append_child($node); $newnode->set_attribute("align", "left"); - ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml:1.3 phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml Sun Aug 29 17:47:36 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.6 --> <refentry id="function.domelement-tagname"> <refnamediv> <refname>DomElement->tagname</refname> <refpurpose> - Retourne le nom d'un élément + Retourne le nom de l'élément courant </refpurpose> </refnamediv> <refsect1> @@ -16,7 +16,36 @@ <void/> </methodsynopsis> <para> - &warn.undocumented.func; + <methodname>DomElement->tagname</methodname> retourne + le nom du noeud courant. Appeler cette fonction revient à accéder à + la propriété <literal>tagname</literal> ou appeler + <function>DomElement->node_name</function> du noeud courant. + </para> + <para> + <example> + <title>Récupération du nom du noeud</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +$root = $dom->document_element(); +echo $root->tagname(); // chapitre +echo $root->tagname; // chapitre +echo $root->node_name(); // chapitre + + +?> + +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/domxml-version.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/domxml-version.xml diff -u phpdoc-fr/reference/domxml/functions/domxml-version.xml:1.4 phpdoc-fr/reference/domxml/functions/domxml-version.xml:1.5 --- phpdoc-fr/reference/domxml/functions/domxml-version.xml:1.4 Sun Jul 18 19:33:57 2004 +++ phpdoc-fr/reference/domxml/functions/domxml-version.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.2 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> <refentry id="function.domxml-version"> <refnamediv> <refname>domxml_version</refname> @@ -17,6 +17,26 @@ <para> <function>domxml_version</function> lit le numéro de version de la bibliothèque XML actuellement utilisée. + </para> + <para> + <example> + <title>Exemple avec <function>domxml_version</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo domxml_version(); + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +20607 +]]> + </screen> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/mcrypt/reference.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc-fr/reference/mcrypt/reference.xml diff -u phpdoc-fr/reference/mcrypt/reference.xml:1.11 phpdoc-fr/reference/mcrypt/reference.xml:1.12 --- phpdoc-fr/reference/mcrypt/reference.xml:1.11 Sun Aug 1 10:41:42 2004 +++ phpdoc-fr/reference/mcrypt/reference.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> -<!-- EN-Revision: 1.13 Maintainer: didou Status: ready --> +<!-- $Revision: 1.12 $ --> +<!-- EN-Revision: 1.15 Maintainer: didou Status: ready --> <!-- Reviewed: yes --> <reference id="ref.mcrypt"> <title>chiffrement mcrypt</title> @@ -23,11 +23,16 @@ <para> Ces fonctions utilisent <ulink url="&url.mcrypt;">mcrypt</ulink>. Pour utiliser cette bibliothèque, téléchargez - le fichier libmcrypt-x.x.tar.gz sur <ulink url="&url.mcrypt;">&url.mcrypt;</ulink> + le fichier <filename>libmcrypt-x.x.tar.gz</filename> sur + <ulink url="&url.mcrypt;">&url.mcrypt;</ulink> et suivez les instructions d'installation fournies. Les utilisateurs Windows trouveront toutes les bibliothèques nécessaires sur <ulink url="&url.mcrypt.windows;">&url.mcrypt.windows;</ulink>. </para> + <simpara> + Depuis &php; 5.0.0, vous avez besoin de la version 2.5.6 ou suivant de la bibliothèque + libmcrypt. + </simpara> <para> Si vous compilez &php; avec la bibliothèque <literal>libmcrypt 2.4.x</literal>, les algorithmes suivants sont supportés : CAST, LOKI97, RIJNDAEL, SAFERPLUS, http://cvs.php.net/diff.php/phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml diff -u phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml:1.6 phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml:1.7 --- phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml:1.6 Mon Aug 16 12:51:32 2004 +++ phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> <refentry id='function.simplexml-import-dom'> <refnamediv> <refname>simplexml_import_dom</refname> @@ -19,7 +19,7 @@ <para> <!-- same with this link --> <function>simplexml_import_dom</function> prend une node d'un document - <link linkend="ref.domxml">DOM</link> + <link linkend="ref.dom">DOM</link> et la transforme en node SimpleXML. Ce nouvel objet peut alors être utilisé comme un élément natif SimpleXML. Si une erreur survient, la fonction retourne &false;. @@ -44,6 +44,10 @@ ]]> </programlisting> </example> + <para> + Voir aussi + <function>dom_import_simplexml</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/stripslashes.xml?r1=1.10&r2=1.11&ty=u Index: phpdoc-fr/reference/strings/functions/stripslashes.xml diff -u phpdoc-fr/reference/strings/functions/stripslashes.xml:1.10 phpdoc-fr/reference/strings/functions/stripslashes.xml:1.11 --- phpdoc-fr/reference/strings/functions/stripslashes.xml:1.10 Thu Jul 29 13:04:44 2004 +++ phpdoc-fr/reference/strings/functions/stripslashes.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> -<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.11 $ --> +<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready --> <refentry id="function.stripslashes"> <refnamediv> <refname>stripslashes</refname> @@ -44,6 +44,59 @@ ]]> </programlisting> </example> + </para> + <note> + <para> + <function>stripslashes</function> n'est pas récursif. Si vous voulez appliquer + cette fonction à un tableau multi-dimensionnel, vous devez utiliser une fonction + récursive. + </para> + </note> + <para> + <example> + <title>Utilisation de <function>stripslashes</function> sur un tableau</title> + <programlisting role="php"> +<![CDATA[ +<?php +function stripslashes_deep($value) +{ + $value = is_array($value) ? + array_map('stripslashes_deep', $value) : + stripslashes($value); + + return $value; +} + +// Exemple +$array = array('f\'oo', 'b\'ar', array('fo\'o', 'b\'ar')); +$array = stripslashes_deep($array); + +// Affichage +print_r($array); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Array +( + [0] => f'oo + [1] => b'ar + [2] => Array + ( + [0] => fo'o + [1] => b'ar + ) + +) +]]> + </screen> + </example> + </para> + <para> + Pour plus d'informations sur les "magic quotes", lisez + la documentation sur <function>get_magic_quotes_gpc</function>. </para> <simpara> Voir aussi
http://cvs.php.net/diff.php/phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml diff -u phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml:1.2 phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml:1.3 --- phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml:1.2 Thu Aug 19 11:11:30 2004 +++ phpdoc-fr/reference/bcompiler/functions/bcompiler-parse-class.xml Sun Aug 29 17:47:36 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> - <refentry id="pecl.bcompiler.parse_class"> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> + <refentry id="function.bcompiler-parse-class"> <refnamediv> <refname>bcompiler_parse_class</refname> <refpurpose>Lit le bytecode d'une classe et revient à une fonction utilisateur</refpurpose> http://cvs.php.net/diff.php/phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml diff -u phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml:1.2 phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml:1.3 --- phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml:1.2 Thu Aug 19 11:11:30 2004 +++ phpdoc-fr/reference/bcompiler/functions/bcompiler-read.xml Sun Aug 29 17:47:36 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> - <refentry id="funcion.bcompiler-read"> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> + <refentry id="function.bcompiler-read"> <refnamediv> <refname>bcompiler_read</refname> <refpurpose>Lit et crée les classes depuis un descripteur de fichier</refpurpose> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml diff -u phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml:1.7 phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml:1.8 --- phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml:1.7 Tue Aug 10 18:04:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomAttribute-name.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.domattribute-name"> <refnamediv> <refname>DomAttribute->name</refname> @@ -20,7 +20,7 @@ </para> <para> Voir aussi - <function>domattribute_value</function>. + <function>domattribute_value</function> pour un exemple. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml diff -u phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml:1.5 phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml:1.6 --- phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml:1.5 Tue Aug 10 16:32:56 2004 +++ phpdoc-fr/reference/domxml/functions/DomAttribute-value.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.domattribute-value"> <refnamediv> <refname>DomAttribute->value</refname> @@ -17,6 +17,41 @@ <para> <methodname>DomAttribute->value</methodname> retourne la valeur de l'attribut. + </para> + <para> + <example> + <title>Récupération de tous les attributs d'un noeud</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +$root = $dom->document_element(); +$attrs = $root->attributes(); + +echo 'Attributs de ' . $root->node_name() . "\n"; +foreach ($attrs as $attribute) { + echo ' - ' . $attribute->name . ' : ' . $attribute->value . "\n"; +} + +?> + +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Attributs de chapter + - language : en +]]> + </screen> + </example> </para> <para> Voir aussi http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml:1.6 phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml:1.7 --- phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml:1.6 Tue Aug 10 18:04:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocument-add-root.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.domdocument-add-root"> <refnamediv> <refname>DomDocument->add_root</refname> @@ -9,7 +9,7 @@ <refsect1> <title>Description</title> <methodsynopsis> - <type>resource</type><methodname>DomDocument->add_root</methodname> + <type>object</type><methodname>DomDocument->add_root</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> &warn.experimental.func; @@ -26,9 +26,9 @@ <![CDATA[ <?php $doc = domxml_new_doc("1.0"); -$root = $doc->add_root("HTML"); -$head = $root->new_child("HEAD", ""); -$head->new_child("TITLE", "Voilà le titre"); +$root = $doc->add_root("html"); +$head = $root->new_child("head", ""); +$head->new_child("title", "Voilà le titre"); echo htmlentities($doc->dump_mem()); ?> ]]> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.4 phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.5 --- phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.4 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocument-html-dump-mem.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.domdocument-html-dump-mem"> <refnamediv> <refname>DomDocument->html_dump_mem</refname> @@ -26,21 +26,32 @@ <programlisting role="php"> <![CDATA[ <?php + +// Création du document $doc = domxml_new_doc("1.0"); -$root = $doc->create_element("HTML"); + +$root = $doc->create_element("html"); $root = $doc->append_child($root); -$head = $doc->create_element("HEAD"); + +$head = $doc->create_element("head"); $head = $root->append_child($head); -$title = $doc->create_element("TITLE"); + +$title = $doc->create_element("title"); $title = $head->append_child($title); -$text = $doc->create_text_node("This is the title"); + +$text = $doc->create_text_node("Ceci est le titre"); $text = $title->append_child($text); -echo "<pre>"; -echo htmlentities($doc->html_dump_mem()); -echo "</pre>"; + +echo $doc->html_dump_mem(); ?> ]]> </programlisting> + &example.outputs; + <screen role="xml"> +<![CDATA[ +<html><head><title>Ceci est le titre</title></head></html> +]]> + </screen> </example> </para> <para> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml:1.3 phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocumentType-name.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.domdocumenttype-name"> <refnamediv> <refname>DomDocumentType->name</refname> @@ -16,6 +16,28 @@ </methodsynopsis> <para> <function>DomDocumentType->name</function> retourne le nom du type de document. + </para> + <para> + <example> + <title>Récupération du nom du type du document</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur pendant l'analyse du document\n"; + exit; +} + +$doctype = $dom->doctype(); +echo $doctype->name(); // chapitre + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml:1.3 phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocumentType-system-id.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.domdocumenttype-system-id"> <refnamediv> <refname>DomDocumentType->system_id</refname> @@ -19,8 +19,6 @@ système du type de document. </para> <para> - L'exemple ci-dessous affichera - '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd'. <example> <title>Lire un identifiant système DOM XML</title> <programlisting role="php"> @@ -38,6 +36,12 @@ ?> ]]> </programlisting> + &example.outputs; + <screen> +<![CDATA[ +/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd +]]> + </screen> </example> </para> </refsect1> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml diff -u phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml:1.4 phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml:1.5 --- phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml:1.4 Fri Aug 20 16:34:21 2004 +++ phpdoc-fr/reference/domxml/functions/DomDocument-xinclude.xml Sun Aug 29 17:47:36 2004 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.domdocument-xinclude"> <refnamediv> <refname>DomDocument->xinclude</refname> - <refpurpose>Remplace XIncludes dans un objet domdocument</refpurpose> + <refpurpose>Remplace XIncludes dans un objet DomDocument</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -13,8 +13,59 @@ <void/> </methodsynopsis> &warn.experimental.func; - &warn.undocumented.func; + <para> + <function>DomDocument->xinclude</function> substitue <literal>XIncludes</literal> + dans un objet DomDocument. + </para> + <para> + <example> + <title>Substitution</title> + <programlisting role="php"> +<![CDATA[ +<?php +// include.xml contient : +// <child>test</child> + +$xml = '<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:include href="include.xml"> + <xi:fallback> + <error>xinclude: include.xml n\'a pas été trouvé</error> + </xi:fallback> + </xi:include> +</root>'; + +$domxml = domxml_open_mem($xml); +$domxml->xinclude(); + +echo $domxml->dump_mem(); + +?> +]]> + </programlisting> + &example.outputs; + <screen role="xml"> +<![CDATA[ +<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <child>test</child> +</root> +]]> + </screen> + <para> + Si <filename>include.xml</filename> n'existe pas, vous verez : + </para> + <screen role="xml"> +<![CDATA[ +<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <error>xinclude:dom.xml n'a pas été trouvé</error> +</root> +]]> + </screen> + </example> + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml:1.3 phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-get-attribute-node.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.domelement-get-attribute-node"> <refnamediv> <refname>DomElement->get_attribute_node</refname> @@ -12,10 +12,39 @@ <title>Description</title> <methodsynopsis> <type>object</type><methodname>DomElement->get_attribute_node</methodname> - <methodparam><type>object</type><parameter>attr</parameter></methodparam> + <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + <methodname>DomElement->get_attribute_node</methodname> retourne + le noeud de l'attribut nommé <parameter>name</parameter> dans + l'élément courant. Le paramètre <parameter>name</parameter> est sensible à la casse. + </para> + <para> + Si aucun attribut portant le nom fourni n'est trouvé, &false; est retourné. + </para> + <para> + <example> + <title>Récupération d'un attribut d'un noeud</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +$root = $dom->document_element(); +if ($attribute = $root->get_attribute_node('language')) { + echo 'Le langage est : ' . $attribute->value() . "\n"; +} + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml:1.4 phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml:1.5 --- phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml:1.4 Wed Jun 16 17:08:31 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-get-attribute.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.domelement-get-attribute"> <refnamediv> <refname>DomElement->get_attribute</refname> @@ -11,7 +11,7 @@ <refsect1> <title>Description</title> <methodsynopsis> - <type>object</type><methodname>DomElement->get_attribute</methodname> + <type>string</type><methodname>DomElement->get_attribute</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> <para> @@ -21,6 +21,29 @@ <para> (&php; >= 4.3 uniquement) Si aucun attribut de nom <parameter>name</parameter> n'est trouvé, une chaîne vide est retournée. + </para> + <para> + <example> + <title>Récupération de la valeur d'un attribut</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +// get chapter +$root = $dom->document_element(); +echo $root->get_attribute('language')); // en + +?> +]]> + </programlisting> + </example> </para> <para> Voir aussi http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml:1.3 phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-has-attribute.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.domelement-has-attribute"> <refnamediv> <refname>DomElement->has_attribute</refname> @@ -13,7 +13,36 @@ <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + <methodname>DomElement->has_attribute</methodname> vérifie l'existence + d'un attribut nommé <parameter>name</parameter> dans le noeud courant. + </para> + <para> + <example> + <title>Test l'existence d'un attribut</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +$root = $dom->document_element(); + +$buffer = '<html' +if ($root->has_attribute('language')) { + $buffer .= 'lang="' . $root->get_attribute('language') . '"'; +} +$buffer .= '>'; + +?> + +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml:1.4 phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml:1.5 --- phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml:1.4 Mon Aug 9 13:04:02 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-set-attribute.xml Sun Aug 29 17:47:36 2004 @@ -1,17 +1,17 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.7 Maintainer: didou Status: ready --> <refentry id="function.domelement-set-attribute"> <refnamediv> <refname>DomElement->set_attribute</refname> <refpurpose> - Ajoute un nouvel attribut + Définie la valeur d'un attribut </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> - <type>bool</type><methodname>DomElement->set_attribute</methodname> + <type>object</type><methodname>DomElement->set_attribute</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> @@ -26,12 +26,10 @@ <programlisting role="php"> <![CDATA[ <?php - $doc = domxml_new_doc("1.0"); $node = $doc->create_element("para"); $newnode = $doc->append_child($node); $newnode->set_attribute("align", "left"); - ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml diff -u phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml:1.3 phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml:1.4 --- phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml:1.3 Tue Apr 27 21:55:38 2004 +++ phpdoc-fr/reference/domxml/functions/DomElement-tagname.xml Sun Aug 29 17:47:36 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.6 --> <refentry id="function.domelement-tagname"> <refnamediv> <refname>DomElement->tagname</refname> <refpurpose> - Retourne le nom d'un élément + Retourne le nom de l'élément courant </refpurpose> </refnamediv> <refsect1> @@ -16,7 +16,36 @@ <void/> </methodsynopsis> <para> - &warn.undocumented.func; + <methodname>DomElement->tagname</methodname> retourne + le nom du noeud courant. Appeler cette fonction revient à accéder à + la propriété <literal>tagname</literal> ou appeler + <function>DomElement->node_name</function> du noeud courant. + </para> + <para> + <example> + <title>Récupération du nom du noeud</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("example.inc"); + +if (!$dom = domxml_open_mem($xmlstr)) { + echo "Erreur lors de l'analyse du document\n"; + exit; +} + +$root = $dom->document_element(); +echo $root->tagname(); // chapitre +echo $root->tagname; // chapitre +echo $root->node_name(); // chapitre + + +?> + +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/domxml/functions/domxml-version.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/domxml/functions/domxml-version.xml diff -u phpdoc-fr/reference/domxml/functions/domxml-version.xml:1.4 phpdoc-fr/reference/domxml/functions/domxml-version.xml:1.5 --- phpdoc-fr/reference/domxml/functions/domxml-version.xml:1.4 Sun Jul 18 19:33:57 2004 +++ phpdoc-fr/reference/domxml/functions/domxml-version.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.2 Maintainer: didou Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> <refentry id="function.domxml-version"> <refnamediv> <refname>domxml_version</refname> @@ -17,6 +17,26 @@ <para> <function>domxml_version</function> lit le numéro de version de la bibliothèque XML actuellement utilisée. + </para> + <para> + <example> + <title>Exemple avec <function>domxml_version</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo domxml_version(); + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +20607 +]]> + </screen> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/mcrypt/reference.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc-fr/reference/mcrypt/reference.xml diff -u phpdoc-fr/reference/mcrypt/reference.xml:1.11 phpdoc-fr/reference/mcrypt/reference.xml:1.12 --- phpdoc-fr/reference/mcrypt/reference.xml:1.11 Sun Aug 1 10:41:42 2004 +++ phpdoc-fr/reference/mcrypt/reference.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> -<!-- EN-Revision: 1.13 Maintainer: didou Status: ready --> +<!-- $Revision: 1.12 $ --> +<!-- EN-Revision: 1.15 Maintainer: didou Status: ready --> <!-- Reviewed: yes --> <reference id="ref.mcrypt"> <title>chiffrement mcrypt</title> @@ -23,11 +23,16 @@ <para> Ces fonctions utilisent <ulink url="&url.mcrypt;">mcrypt</ulink>. Pour utiliser cette bibliothèque, téléchargez - le fichier libmcrypt-x.x.tar.gz sur <ulink url="&url.mcrypt;">&url.mcrypt;</ulink> + le fichier <filename>libmcrypt-x.x.tar.gz</filename> sur + <ulink url="&url.mcrypt;">&url.mcrypt;</ulink> et suivez les instructions d'installation fournies. Les utilisateurs Windows trouveront toutes les bibliothèques nécessaires sur <ulink url="&url.mcrypt.windows;">&url.mcrypt.windows;</ulink>. </para> + <simpara> + Depuis &php; 5.0.0, vous avez besoin de la version 2.5.6 ou suivant de la bibliothèque + libmcrypt. + </simpara> <para> Si vous compilez &php; avec la bibliothèque <literal>libmcrypt 2.4.x</literal>, les algorithmes suivants sont supportés : CAST, LOKI97, RIJNDAEL, SAFERPLUS, http://cvs.php.net/diff.php/phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml diff -u phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml:1.6 phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml:1.7 --- phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml:1.6 Mon Aug 16 12:51:32 2004 +++ phpdoc-fr/reference/simplexml/functions/simplexml-import-dom.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> <refentry id='function.simplexml-import-dom'> <refnamediv> <refname>simplexml_import_dom</refname> @@ -19,7 +19,7 @@ <para> <!-- same with this link --> <function>simplexml_import_dom</function> prend une node d'un document - <link linkend="ref.domxml">DOM</link> + <link linkend="ref.dom">DOM</link> et la transforme en node SimpleXML. Ce nouvel objet peut alors être utilisé comme un élément natif SimpleXML. Si une erreur survient, la fonction retourne &false;. @@ -44,6 +44,10 @@ ]]> </programlisting> </example> + <para> + Voir aussi + <function>dom_import_simplexml</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/stripslashes.xml?r1=1.10&r2=1.11&ty=u Index: phpdoc-fr/reference/strings/functions/stripslashes.xml diff -u phpdoc-fr/reference/strings/functions/stripslashes.xml:1.10 phpdoc-fr/reference/strings/functions/stripslashes.xml:1.11 --- phpdoc-fr/reference/strings/functions/stripslashes.xml:1.10 Thu Jul 29 13:04:44 2004 +++ phpdoc-fr/reference/strings/functions/stripslashes.xml Sun Aug 29 17:47:36 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> -<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.11 $ --> +<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready --> <refentry id="function.stripslashes"> <refnamediv> <refname>stripslashes</refname> @@ -44,6 +44,59 @@ ]]> </programlisting> </example> + </para> + <note> + <para> + <function>stripslashes</function> n'est pas récursif. Si vous voulez appliquer + cette fonction à un tableau multi-dimensionnel, vous devez utiliser une fonction + récursive. + </para> + </note> + <para> + <example> + <title>Utilisation de <function>stripslashes</function> sur un tableau</title> + <programlisting role="php"> +<![CDATA[ +<?php +function stripslashes_deep($value) +{ + $value = is_array($value) ? + array_map('stripslashes_deep', $value) : + stripslashes($value); + + return $value; +} + +// Exemple +$array = array('f\'oo', 'b\'ar', array('fo\'o', 'b\'ar')); +$array = stripslashes_deep($array); + +// Affichage +print_r($array); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Array +( + [0] => f'oo + [1] => b'ar + [2] => Array + ( + [0] => fo'o + [1] => b'ar + ) + +) +]]> + </screen> + </example> + </para> + <para> + Pour plus d'informations sur les "magic quotes", lisez + la documentation sur <function>get_magic_quotes_gpc</function>. </para> <simpara> Voir aussi