cvs: peardoc /fr/package/xml/xml-sql2xml example.xml intro-passing.xml intro-simple.xml intro-xpath.xml /fr/package/xml/xml-sql2xml/xml-sql2xml
add.xml addarray.xml addresult.xml addsql.xml addxmlfile.xml addxmlstring.xml getxml.xml getxmlobject.xml getxpathchildvalues.xml getxpathvalue.xml
setencoding.xml setoptions.xml setparenttables.xml xml-sql2xml.xml
| From: | Yannick TORRES | Date: | Tue, 03 Aug 2004 06:25:17 +0000 |
| Subject: | cvs: peardoc /fr/package/xml/xml-sql2xml example.xml intro-passing.xml intro-simple.xml intro-xpath.xml /fr/package/xml/xml-sql2xml/xml-sql2xml add.xml addarray.xml addresult.xml addsql.xml addxmlfile.xml addxmlstring.xml getxml.xml getxmlobject.xml getxpathchildvalues.xml getxpathvalue.xml setencoding.xml setoptions.xml setparenttables.xml xml-sql2xml.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-4720@lists.php.net to get a copy of this message | ||
yannick Tue Aug 3 02:25:17 2004 EDT
Added files:
/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml addarray.xml
addresult.xml
addsql.xml add.xml
addxmlfile.xml
addxmlstring.xml
getxmlobject.xml
getxml.xml
getxpathchildvalues.xml
getxpathvalue.xml
setencoding.xml
setoptions.xml
setparenttables.xml
xml-sql2xml.xml
/peardoc/fr/package/xml/xml-sql2xml example.xml intro-passing.xml
intro-simple.xml
intro-xpath.xml
Log:
initial translation
http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addarray.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addarray.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addarray.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addarray"> <refnamediv> <refname>XML_sql2xml::addArray</refname> <refpurpose>Ajoute un autre jeu de résultats issu d'un tableau</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addArray</function></funcdef> <paramdef> array <parameter>$array</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addarray.desc"> &title.desc; <para> Ajoute un autre jeu de résultats généré depuis un tableau. Le XML représente la structure du tableau. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addarray.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>array $array</parameter> - données sous forme d'un tableau </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addarray.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addarray.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add">XML_sql2xml::add()</link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addresult.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addresult.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addresult.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addresult"> <refnamediv> <refname>XML_sql2xml::addResult</refname> <refpurpose>Ajoute un jeu de résultats PEAR::DB</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addResult</function></funcdef> <paramdef> Object <parameter>$result</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addresult.desc"> &title.desc; <para> Ajoute un jeu de résultats additionnels PEAR::&class.db-result;. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addresult.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>Object $result</parameter> - un objet &class.db-result; </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addresult.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addresult.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add">XML_sql2xml::add()</link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addsql.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addsql.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addsql.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addsql"> <refnamediv> <refname>XML_sql2xml::addSql</refname> <refpurpose>Ajoute un jeu de résultats depuis une requête SQL</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addSql</function></funcdef> <paramdef> string <parameter>$sql</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addsql.desc"> &title.desc; <para> Ajoute un jeu de résultats additionnel généré depuis une requête SQL. La fonction exécute une requête et la transforme en XML. Vous devez passer un <link linkend="package.database.db.intro-dsn">DSN</link> au <link linkend="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml"> constructeur</link>. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addsql.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $sql</parameter> - une chaîne contenant la requête SQL. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addsql.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addsql.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml"><function>XML_sql2xml::XML_sql2xml</function></link>, <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>XML_sql2xml::add</function></link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/add.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/add.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/add.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.add"> <refnamediv> <refname>XML_sql2xml::add</refname> <refpurpose>Méthode générale pour ajouter de nouveaux jeux de résultats</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::add</function></funcdef> <paramdef> string <parameter>$resultset</parameter> </paramdef> <paramdef> mixed <parameter><optional>$params = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.desc"> &title.desc; <para> Méthode générale pour ajouter de nouveaux jeux de résultats à l'objet. Donnez une requête SQL, un objet PEAR::&class.db-result; ou un tableau en tant que paramètre d'entrée et la méthode appelle la méthode appropriée por cette entrée. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $resultset</parameter> - requête SQL, un objet &class.db-result; ou un tableau </para> </listitem> <listitem> <para> <parameter>mixed $params</parameter> - les paramètres pour les fonctions suivantes </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.addresult">XML_sql2xml::addResult()</link>, <link linkend="package.xml.xml-sql2xml.xml-sql2xml.addsql">XML_sql2xml::addSql()</link>, <link linkend="package.xml.xml-sql2xml.xml-sql2xml.addarray">XML_sql2xml::addArray()</link>, <link linkend="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile">XML_sql2xml::addXmlFile()</link> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.example"> &title.example; <example> <title>Utilisation de <function>add</function></title> <programlisting role="php"> <![CDATA[ $sql2xml->Add("select * from bands"); ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlfile.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlfile.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlfile.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile"> <refnamediv> <refname>XML_sql2xml::addXmlFile</refname> <refpurpose>Ajoute un fichier XML</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addXmlFile</function></funcdef> <paramdef> string <parameter>$file</parameter> </paramdef> <paramdef> mixed <parameter><optional>$xpath = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile.desc"> &title.desc; <para> Ajoute le contenu d'un fichier XML depuis le même degrès qu'un jeu de résultats normal (habituellement, juste après le tag racine). </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $file</parameter> - nom du fichier </para> </listitem> <listitem> <para> <parameter>mixed $xpath</parameter> - soit une chaîne avec une expression XPath ou un tableau avec les clés "xpath"=>expression XPath et "root"=>tag/subtag/etc, qui sont les tags à être insérés avant le résultat. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>XML_sql2xml::add</function></link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlstring.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlstring.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlstring.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring"> <refnamediv> <refname>XML_sql2xml::addXmlString</refname> <refpurpose>Ajoute une chaîne XML</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addXmlString</function></funcdef> <paramdef> string <parameter>$string</parameter> </paramdef> <paramdef> mixed <parameter><optional>$xpath = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring.desc"> &title.desc; <para> Ajoute le contenu d'une chaîne XML depuis le même degrès qu'un jeu de résultats normal (habituellement, juste après le tag racine). </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $string</parameter> - XML string </para> </listitem> <listitem> <para> <parameter>mixed $xpath</parameter> - soit une chaîne avec une expression XPath ou un tableau avec les clés "xpath"=>expression XPath et "root"=>tag/subtag/etc, qui sont les tags à être insérés avant le résultat. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>XML_sql2xml::add</function></link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxmlobject.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxmlobject.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxmlobject.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject"> <refnamediv> <refname>XML_sql2xml::getXMLObject</refname> <refpurpose>retourne un objet XML DomDocument</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>Object <function>XML_sql2xml::getXMLObject</function></funcdef> <paramdef> mixed <parameter><optional>$result = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject.desc"> &title.desc; <para> Retourne un objet XML DomDocument object avec une représentation XML des jeux de résultats. Le jeu de résultat peut être directement fournis ici ou bien, si vous avez besoin de plus d'un jeu dans votre Xml, alors, vous pouvez les fournir un par un avec la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>add</function></link> avant d'appeler <function>getXMLObject</function>, mais le dernier peut également être fournis ici. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>mixed $result</parameter> - un objet &class.db-result; depuis une requête &class.db; </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject.return"> &title.returns; <para> <parameter>Object</parameter> - un objet DomDocument </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject.note"> &title.note; ¬e.notstatic; <simpara></simpara> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxml.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxml.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxml.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.getxml"> <refnamediv> <refname>XML_sql2xml::getXML</refname> <refpurpose>Retourne une représentation XML du jeu de résultat</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>XML_sql2xml::getXML</function></funcdef> <paramdef> mixed <parameter><optional>$result = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxml.desc"> &title.desc; <para> Retourne une chaîne XML avec une représentation XML du jeu de résultats. Le jeu de résultat peut être directement fournis ici ou bien, si vous avez besoin de plus d'un jeu dans votre Xml, alors, vous pouvez les fournir un par un avec la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>add</function></link> avant d'appeler <function>getXML</function>, mais le dernier peut également être fournis ici. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxml.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>mixed $result</parameter> - un obejt &class.db-result; depuis une requête &class.db; ou une requête SQL </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxml.return"> &title.returns; <para> <parameter>string</parameter> - la chaîne XML </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxml.note"> &title.note; ¬e.notstatic; <simpara></simpara> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathchildvalues.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathchildvalues.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathchildvalues.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues"> <refnamediv> <refname>XML_sql2xml::getXpathChildValues</refname> <refpurpose>retourne les tags fils qui correspondent à une expression XPath</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>XML_sql2xml::getXpathChildValues</function></funcdef> <paramdef> string <parameter>$expr</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.desc"> &title.desc; <para> Retourne les valeurs depuis les tags fils correspondant à la première correspondance avec une expression XPath. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $expr</parameter> - expression XPath </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.return"> &title.returns; <para> <parameter>array</parameter> - le contenu des tags fils. Le nom du tag fils est assigné à la clé, le contenu, à la valeur. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue"> <function>XML_sql2xml::getXpathValue</function> </link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathvalue.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathvalue.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathvalue.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue"> <refnamediv> <refname>XML_sql2xml::getXpathValue</refname> <refpurpose>retourne les correspondances à une expression XPath</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>XML_sql2xml::getXpathValue</function></funcdef> <paramdef> string <parameter>$expr</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.desc"> &title.desc; <para> Retourne le contenu de la première correspondance à uneexpression XPath. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $expr</parameter> - expression XPath </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.return"> &title.returns; <para> <parameter>mixed</parameter> - contenu de l'expression XPath évaluée </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues"> <function>XML_sql2xml::getXpathChildValues</function> </link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setencoding.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setencoding.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setencoding.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.setencoding"> <refnamediv> <refname>XML_sql2xml::setEncoding</refname> <refpurpose>définie le jeu de caractères d'encodage</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::setEncoding</function></funcdef> <paramdef> string <parameter><optional>$encoding_from="ISO-8859-1"</optional></parameter> </paramdef> <paramdef> string <parameter><optional>$encoding_to="UTF-8"</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setencoding.desc"> &title.desc; <para> Définie le jeu de caractères d'encodage pour la transformation db2xml. La valeur <parameter>$encoding_from</parameter> dépend de votre système de base de données ; vérifiez le manuel DBMS pour connaître le jeu d'encodage utilisé par votre système pour les jeux de résultats. </para> <para> Le paramètre <parameter>$encoding_to</parameter> définie le jeu d'encodage pour le document XML créé. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setencoding.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $encoding_from</parameter> - encodage d'entrée </para> </listitem> <listitem> <para> <parameter>string $encoding_to</parameter> - encodage de sortie </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setencoding.note"> &title.note; ¬e.notstatic; <simpara></simpara> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setoptions.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setoptions.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setoptions.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.setoptions"> <refnamediv> <refname>XML_sql2xml::setOptions</refname> <refpurpose>définie les options pour l'instance</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::setOptions</function></funcdef> <paramdef> array <parameter>$options</parameter> </paramdef> <paramdef> constant <parameter><optional>$delete=&false;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setoptions.desc"> &title.desc; <para> Cette méthode définie les options pour l'instance de la classe. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setoptions.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>array $options</parameter> - tableau d'options. Les clés du tableau définissent les options à définir. Les options disponibles sont : <itemizedlist> <listitem> <para>boolean <parameter>$options['nested']</parameter> - si &true;, le résultat d'une requête jointe sera traité normalement. Par défaut, &false;. </para> </listitem> <listitem> <para>boolean <parameter>$options['tagNameRow']</parameter> - nom pour le tag 'ligne'. Par défaut, <literal>row</literal>. </para> </listitem> <listitem> <para>boolean <parameter>$options['tagNameResult']</parameter> - nom pour le tag 'résultat'. Par défaut, <literal>result</literal>. </para> </listitem> </itemizedlist> </para> </listitem> <listitem> <para> <parameter>constant $delete</parameter> - les anciennes options doivent être effacées </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setoptions.note"> &title.note; ¬e.notstatic; <simpara></simpara> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setparenttables.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setparenttables.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setparenttables.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables"> <refnamediv> <refname>XML_sql2xml::SetParentTables</refname> <refpurpose></refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::SetParentTables</function></funcdef> <paramdef> array <parameter>$parentTables</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.desc"> &title.desc; <para> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>array $parentTables</parameter> - relation parent à enfant </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.see"> &title.see; <!-- Additional links go here --> <para> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.example"> &title.example; <example> <title>Utilisation de <function>SetParentTables</function></title> <programlisting role="php"> <![CDATA[ ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/xml-sql2xml.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/xml-sql2xml.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/xml-sql2xml.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml"> <refnamediv> <refname>XML_sql2xml::XML_sql2xml</refname> <refpurpose>Constructeur</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::XML_sql2xml</function></funcdef> <paramdef> mixed <parameter><optional>$dsn = &null;</optional></parameter> </paramdef> <paramdef> string <parameter><optional>$root="root"</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.desc"> &title.desc; <para> Le constructeur peut prendre un objet Pear::DB <link linkend="package.database.db.intro-dsn">Data Source Name (DSN)</link> et donc, se connectera à la base de données ; ou un objet PEAR::DB, si vous vous êtes déjà connecté à la base de données. Fournir une chaîne SQL ne fonctionnera pas. </para> <para> Si vous fournissez uniquement un DSN, vous devez utiliser la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add">add</link> pour ajouter un objet &class.db-result;, une requête SQL ou un tableau plus tard. </para> <para> Le paramètre <parameter>$root</parameter> est utilisé si vous voulez fournir un autre nom pour le tag racine à la place de <literal>root</literal>. Si vous donnez une chaîne vide (''), il n'y aura pas de tag racine de créé ici, mais uniquement lorsque vous ajouterez un jeu de résultats, un tableau ou une requête SQL. Et ainsi, le premier tag de ce résultat sera utilisé comme élément racine. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>mixed $dsn</parameter> - PEAR::DB <literal>data source name</literal> ou un objet &class.db-common; </para> </listitem> <listitem> <para> <parameter>string $root</parameter> - le nom de l'élément racine XML. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.note"> &title.note; ¬e.canstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>XML_sql2xml::add</function></link> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.example"> &title.example; <example> <title>Utilisation de <function>XML_sql2xml</function></title> <programlisting role="php"> <![CDATA[ $sql2xml = new xml_sql2xml("mysql://root@localhost/xmltest"); $sql2xml->Add("select * from bands"); ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/example.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/example.xml +++ peardoc/fr/package/xml/xml-sql2xml/example.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.example"> <refnamediv> <refname>Exemple(s)</refname> <refpurpose>Exemple(s)</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-sql2xml.example.example1"> <title></title> <para> Description d'exemple </para> <!-- the cdata section will formated "as is take care for tabulators --> <programlisting role="php"> <![CDATA[ ]]> </programlisting> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/intro-passing.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/intro-passing.xml +++ peardoc/fr/package/xml/xml-sql2xml/intro-passing.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.intro-passing"> <refnamediv> <refname>Introduction</refname> <refpurpose>Passer les données à transformer</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-sql2xml.intro-passing.overview"> <title>Vue d'ensemble</title> <para> Il y a trois façons de passer des données pour transformation à l'objet : <itemizedlist> <listitem> <para> <emphasis>avec une requête directe</emphasis> </para> <para> Cette façon a été détaillée dans la <link linkend="package.xml.xml-sql2xml.intro-simple">première partie</link> de l'introduction. </para> </listitem> <listitem> <para> <emphasis>avec un objet &class.db-result; existant</emphasis> </para> <para> Si vous avez besoin de l'API complète de <link linkend="package.database.db"><classname>PEAR::DB</classname></link> ou <classname>PEAR::MDB</classname>, vous devriez choisir cette façon. </para> </listitem> <listitem> <para> <emphasis>avec un tableau</emphasis> </para> <para> Ce n'est pas directement une transformation SQL en XML ; si vous passez un tableau indexé à l'instance, les clés du tableau seront transformées en tag XML et leurs valeurs seront placées dans le contenu du tag. Cette fonctionnalité vous aident à ajouter des données à un jeu de résultats transformés XML. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-passing.query"> <title>Requête directe</title> <para> Ce comportement se connecte au DBMS, exécute la requête et traite le résultat automatiquement. <classname>XML_sql2xml</classname> requière un &intro.db-dsn; valide comme paramètre du <link linkend="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml">construteur</link>. La requête doit être passée à la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>getXML</function></link> ou <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>add</function></link>. </para> <para> Lisez la <link linkend="package.xml.xml-sql2xml.intro-simple">première partie</link> de l'introduction pour des exemples. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-passing.db-result"> <title>Passer un objet DB_Result</title> <para> <link linkend="package.database.db"><classname>PEAR::DB</classname></link> et <classname>PEAR::MDB</classname> retournent le jeu de résultats de la requête comme objet &class.db-result;. Vous devez fournir une instance &class.db-common; au <link linkend="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml">construteur</link> et l'instance &class.db-result; à la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>getXML</function></link> ou <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>add</function></link>. </para> <example> <title>Passer un objet DB_Result</title> <programlisting role="php"> <![CDATA[ <?php require_once "XML/sql2xml.php"; require_once "DB.php"; $db = db::connect("mysql://username:password@localhost/xmltest"); $result = $db->query("select * from bands"); $sql2xmlclass = new xml_sql2xml($db); $xmlstring = $sql2xmlclass->getxml($result); ?> ]]> </programlisting> </example> <para> L'affichage XML dans le paramètre <parameter>$xmlstring</parameter> est égal à l'exemple dans <link linkend="package.xml.xml-sql2xml.intro-simple.simple"> "L'utilisation typique"</link>. </para> <para> Cette façon est la seule, si vous voulez bénéficier de toutes les fonctionnalités de l'APIs de la base de données. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-passing.array"> <title>Passer un tableau</title> <para> Si vous passez un tableau indexé à la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>getXML</function></link> ou <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>add</function></link>, il sera transformé en un document XML. </para> <example> <title>Passer un tableau</title> <programlisting role="php"> <![CDATA[ <?php require_once "XML/sql2xml.php"; $sql2xmlclass = new xml_sql2xml(); $array = array ( array("name"=>"The Blabbers", "birth_year"=>"1998", "birth_place"=>"London", "genre"=>"Rock'n'Roll"), array("name"=>"Only Stupids", "birth_year"=>"1997", "birth_place"=>"New York", "genre"=>"hiphop") ); $xmlstring = $sql2xmlclass->getXML($array); ?> ]]> </programlisting> <para>Le XML résultant dans le paramètre <parameter>$xmlstring</parameter> :</para> <programlisting role="php"> <![CDATA[ <?xml version="1.0"?> <root> <result> <row> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> </row> <row> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>hiphop</genre> </row> </result> </root> ]]> </programlisting> </example> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-passing.passcount"> <title>Passer plus d'un jeu de résultats</title> <para> Vous pouvez appeler la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>add</function></link> pour ajouter des jeux de résultats à un document XML. Appeler juste la méthode pour chaque jeu de résultats ; si vous avez ajouté tous les jeux de résultats, appelez <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>getXml</function></link> sans aucun argument pour récupérer le document XML. </para> <example> <title>Ajout de jeux de résultats</title> <programlisting role="php"> <![CDATA[ $sql2xmlclass->add("select * from bands"); $sql2xmlclass->add("select * from albums"); $xmlstring= $sql2xmlclass->getxml(); ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/intro-simple.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/intro-simple.xml +++ peardoc/fr/package/xml/xml-sql2xml/intro-simple.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.intro-simple"> <refnamediv> <refname>Introduction</refname> <refpurpose>Transformations simples</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-sql2xml.intro-simple.dbsample"> <title>Exemple de base de données</title> <para> Dans ce tutorial, les exemples réfèrent à cette table de base de données : <programlisting> <![CDATA[ mysql> select * from bands; +----+--------------+------------+-------------+-------------+ | id | name | birth_year | birth_place | genre | +----+--------------+------------+-------------+-------------+ | 1 | The Blabbers | 1998 | London | Rock'n'Roll | | 2 | Only Stupids | 1997 | New York | Hip Hop | +----+--------------+------------+-------------+-------------+ mysql> select * from albums; +----+---------+------------------+------+-----------------+ | id | bandsID | title | year | comment | +----+---------+------------------+------+-----------------+ | 1 | 1 | BlaBla | 1998 | Their first one | | 2 | 1 | More Talks | 2000 | The second one | | 3 | 2 | All your base... | 1999 | The Classic | +----+---------+------------------+------+-----------------+ ]]> </programlisting> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-simple.simple"> <title>L'utilisation typique</title> <para> Commençons par un exemple utilisant les options par défaut. La nouvelle instance est liée à un &intro.db-dsn;, donc, vous n'avez qu'à fournir une requête SQL. L'instance traite le résultat automatiquement ; dans le paramètre <parameter>$xmlstring</parameter>, vous trouvez la représentation XML du jeu de résultats. </para> <example> <title>Un exemple simple</title> <programlisting role="php"> <![CDATA[ <?php require_once "XML/sql2xml.php"; $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $xmlstring = $sql2xmlclass->getxml("select * from bands"); ?> ]]> </programlisting> <para> Le contenu du paramètre <parameter>$xmlstring</parameter> basé sur la table ci-dessus sera : </para> <programlisting> <![CDATA[ <?xml version="1.0"?> <root> <result> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> </row> <row> <id>2</id> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>Hip Hop</genre> </row> </result> </root> ]]> </programlisting> </example> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-simple.join"> <title>Transformation basé sur des jointures de requêtes</title> <para> Si le résultat de votre requête est basé sur des jointures de tables, une structure de données XML peut représenter comment le DBMS joint les tables. Pour activer ou désactiver ce comportement, utilisez <link linkend="package.xml.xml-sql2xml.xml-sql2xml.setoptions"> <function>setOptions</function></link> avec la clé option <parameter>'nested'</parameter>. La valeur par défaut est &true; - le comportement est activé. </para> <example> <title>Le jeu de résultats</title> <programlisting role="php"> <![CDATA[ <?php $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $xmlstring = $sql2xmlclass->getxml("select * from bands left join albums on bands.id = bandsID"); ?> ]]> </programlisting> <para> L'affichage XML généré dans <parameter>$xmlstring</parameter> : </para> <programlisting> <![CDATA[ <?xml version="1.0"?> <root> <result> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> <row> <id>1</id> <bandsID>1</bandsID> <title>BlaBla</title> <year>1998</year> <comment>Their first one</comment> </row> <row> <id>2</id> <bandsID>1</bandsID> <title>More Talks</title> <year>2000</year> <comment>The second one</comment> </row> </row> <row> <id>2</id> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>Hip Hop</genre> <row> <id>3</id> <bandsID>2</bandsID> <title>All your base...</title> <year>1999</year> <comment>The Classic</comment> </row> </row> </result> </root> ]]> </programlisting> </example> <para> Si vous désactivez ce comportement, la structure XML des lignes est plate. </para> <example> <title>Le jeu de résultats</title> <programlisting role="php"> <![CDATA[ <?php $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $options = array('nested' => false); $sql2xmlclass->setOptions($options); $xmlstring = $sql2xmlclass->getxml("select * from bands left join albums on bands.id = bandsID"); ?> ]]> </programlisting> <para> affichage XML : </para> <programlisting> <![CDATA[ $xmlstring => <?xml version="1.0"?> <root> <result> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> <id>1</id> <bandsID>1</bandsID> <title>BlaBla</title> <year>1998</year> <comment>Their first one</comment> </row> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> <id>2</id> <bandsID>1</bandsID> <title>More Talks</title> <year>2000</year> <comment>The second one</comment> </row> <row> <id>2</id> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>Hip Hop</genre> <id>3</id> <bandsID>2</bandsID> <title>All your base...</title> <year>1999</year> <comment>The Classic</comment> </row> </result> </root> ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/intro-xpath.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/intro-xpath.xml +++ peardoc/fr/package/xml/xml-sql2xml/intro-xpath.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.intro-xpath"> <refnamediv> <refname>Introduction</refname> <refpurpose>Utilisation de XPath</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-sql2xml.intro-xpath.why"> <title>Que supporte XPath ?</title> <para> Le support de XPath a été introduit pour fournir un accès au jeu de résultats après avoir exécuté la requête SQL. Celà permet de traiter le jeu de résultats sans interroger de nouveau la base de données une fois de plus. </para> <para> XPath est un standard W3 et pour de plus amples informations concernant celà, lisez vos livres préférés XSL/XML ou <ulink url="&url.w3;">&url.w3;</ulink>. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-xpath.getxpath"> <title>Passer une expression XPath</title> <para> <classname>XML_sql2xml</classname> fournit deux fonctions pour traiter le jeu de résultats : <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue"> <function>getXpathValue</function></link> et <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues"> <function>getXpathChildValues</function></link>. Les deux attendent une requête XPath et retournent le résultat en tant que chaîne de caractères ou de tableau. <example> <title>getXpathValue</title> <programlisting role="php"> <![CDATA[ <?php include_once("XML/sql2xml.php"); $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $sql2xmlclass->add("select * from bands"); $xmlstring = $sql2xmlclass->getXpathValue("/root/result/row[id = '2']/name"); ?> ]]> </programlisting> <para> <parameter>$xmlstring</parameter> contient : </para> <programlisting> <![CDATA[ $xmlstring = 'Only Stupids' ]]> </programlisting> </example> <example> <title>getXpathChildValues</title> <programlisting role="php"> <![CDATA[ <?php include_once("XML/sql2xml.php"); $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $sql2xmlclass->add("select * from bands"); $xmlstring = $sql2xmlclass->getXpathChildValues("/root/result/row[id = '2']"); ?> ]]> </programlisting> <para> <parameter>$xmlstring</parameter> contient : </para> <programlisting> <![CDATA[ Array ( [] => [id] => 2 [name] => Only Stupids [birth_year] => 1997 [birth_place] => New York [genre] => Hip Hop ) ]]> </programlisting> </example> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-xpath.mixsqlxpath"> <title>Mélanger les requêtes SQL et XPath</title> <para> Vous pouvez insérer une requête XPath dans une requête SQL. Dans cet exemple, une requête SQL est tout d'abord exécutée, puis, une autre requête SQL est exécutée - mais le paramètre pour <parameter>bandsID</parameter> est pris depuis une expression XPath dans les parenthèses. Cette expression est appliquée dans le jeu de résutat de la <emphasis>première</emphasis> requête SQL. </para> <example> <title>Requête mélangée</title> <programlisting role="php"> <![CDATA[ <?php include_once("XML/sql2xml.php"); $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $sql2xmlclass->add("select * from bands"); $sql2xmlclass->add("select * from albums where bandsID = {/root/result/row[name = 'The Blabbers']/id}"); $xmlstring = $sql2xmlclass->getxml(); ?> ]]> </programlisting> <programlisting> <![CDATA[ $xmlstring = ' <?xml version="1.0"?> <root> <result> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> </row> <row> <id>2</id> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>Hip Hop</genre> </row> </result> <result> <row> <id>1</id> <bandsID>1</bandsID> <title>BlaBla</title> <year>1998</year> <comment>Their first one</comment> </row> <row> <id>2</id> <bandsID>1</bandsID> <title>More Talks</title> <year>2000</year> <comment>The second one</comment> </row> </result> </root> ]]> </programlisting> </example> </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 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 -->
http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addarray.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addarray.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addarray.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addarray"> <refnamediv> <refname>XML_sql2xml::addArray</refname> <refpurpose>Ajoute un autre jeu de résultats issu d'un tableau</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addArray</function></funcdef> <paramdef> array <parameter>$array</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addarray.desc"> &title.desc; <para> Ajoute un autre jeu de résultats généré depuis un tableau. Le XML représente la structure du tableau. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addarray.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>array $array</parameter> - données sous forme d'un tableau </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addarray.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addarray.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add">XML_sql2xml::add()</link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addresult.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addresult.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addresult.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addresult"> <refnamediv> <refname>XML_sql2xml::addResult</refname> <refpurpose>Ajoute un jeu de résultats PEAR::DB</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addResult</function></funcdef> <paramdef> Object <parameter>$result</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addresult.desc"> &title.desc; <para> Ajoute un jeu de résultats additionnels PEAR::&class.db-result;. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addresult.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>Object $result</parameter> - un objet &class.db-result; </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addresult.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addresult.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add">XML_sql2xml::add()</link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addsql.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addsql.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addsql.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addsql"> <refnamediv> <refname>XML_sql2xml::addSql</refname> <refpurpose>Ajoute un jeu de résultats depuis une requête SQL</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addSql</function></funcdef> <paramdef> string <parameter>$sql</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addsql.desc"> &title.desc; <para> Ajoute un jeu de résultats additionnel généré depuis une requête SQL. La fonction exécute une requête et la transforme en XML. Vous devez passer un <link linkend="package.database.db.intro-dsn">DSN</link> au <link linkend="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml"> constructeur</link>. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addsql.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $sql</parameter> - une chaîne contenant la requête SQL. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addsql.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addsql.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml"><function>XML_sql2xml::XML_sql2xml</function></link>, <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>XML_sql2xml::add</function></link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/add.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/add.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/add.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.add"> <refnamediv> <refname>XML_sql2xml::add</refname> <refpurpose>Méthode générale pour ajouter de nouveaux jeux de résultats</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::add</function></funcdef> <paramdef> string <parameter>$resultset</parameter> </paramdef> <paramdef> mixed <parameter><optional>$params = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.desc"> &title.desc; <para> Méthode générale pour ajouter de nouveaux jeux de résultats à l'objet. Donnez une requête SQL, un objet PEAR::&class.db-result; ou un tableau en tant que paramètre d'entrée et la méthode appelle la méthode appropriée por cette entrée. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $resultset</parameter> - requête SQL, un objet &class.db-result; ou un tableau </para> </listitem> <listitem> <para> <parameter>mixed $params</parameter> - les paramètres pour les fonctions suivantes </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.addresult">XML_sql2xml::addResult()</link>, <link linkend="package.xml.xml-sql2xml.xml-sql2xml.addsql">XML_sql2xml::addSql()</link>, <link linkend="package.xml.xml-sql2xml.xml-sql2xml.addarray">XML_sql2xml::addArray()</link>, <link linkend="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile">XML_sql2xml::addXmlFile()</link> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.add.example"> &title.example; <example> <title>Utilisation de <function>add</function></title> <programlisting role="php"> <![CDATA[ $sql2xml->Add("select * from bands"); ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlfile.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlfile.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlfile.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile"> <refnamediv> <refname>XML_sql2xml::addXmlFile</refname> <refpurpose>Ajoute un fichier XML</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addXmlFile</function></funcdef> <paramdef> string <parameter>$file</parameter> </paramdef> <paramdef> mixed <parameter><optional>$xpath = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile.desc"> &title.desc; <para> Ajoute le contenu d'un fichier XML depuis le même degrès qu'un jeu de résultats normal (habituellement, juste après le tag racine). </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $file</parameter> - nom du fichier </para> </listitem> <listitem> <para> <parameter>mixed $xpath</parameter> - soit une chaîne avec une expression XPath ou un tableau avec les clés "xpath"=>expression XPath et "root"=>tag/subtag/etc, qui sont les tags à être insérés avant le résultat. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlfile.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>XML_sql2xml::add</function></link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlstring.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlstring.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/addxmlstring.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring"> <refnamediv> <refname>XML_sql2xml::addXmlString</refname> <refpurpose>Ajoute une chaîne XML</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::addXmlString</function></funcdef> <paramdef> string <parameter>$string</parameter> </paramdef> <paramdef> mixed <parameter><optional>$xpath = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring.desc"> &title.desc; <para> Ajoute le contenu d'une chaîne XML depuis le même degrès qu'un jeu de résultats normal (habituellement, juste après le tag racine). </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $string</parameter> - XML string </para> </listitem> <listitem> <para> <parameter>mixed $xpath</parameter> - soit une chaîne avec une expression XPath ou un tableau avec les clés "xpath"=>expression XPath et "root"=>tag/subtag/etc, qui sont les tags à être insérés avant le résultat. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.addxmlstring.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>XML_sql2xml::add</function></link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxmlobject.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxmlobject.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxmlobject.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject"> <refnamediv> <refname>XML_sql2xml::getXMLObject</refname> <refpurpose>retourne un objet XML DomDocument</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>Object <function>XML_sql2xml::getXMLObject</function></funcdef> <paramdef> mixed <parameter><optional>$result = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject.desc"> &title.desc; <para> Retourne un objet XML DomDocument object avec une représentation XML des jeux de résultats. Le jeu de résultat peut être directement fournis ici ou bien, si vous avez besoin de plus d'un jeu dans votre Xml, alors, vous pouvez les fournir un par un avec la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>add</function></link> avant d'appeler <function>getXMLObject</function>, mais le dernier peut également être fournis ici. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>mixed $result</parameter> - un objet &class.db-result; depuis une requête &class.db; </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject.return"> &title.returns; <para> <parameter>Object</parameter> - un objet DomDocument </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxmlobject.note"> &title.note; ¬e.notstatic; <simpara></simpara> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxml.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxml.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxml.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.getxml"> <refnamediv> <refname>XML_sql2xml::getXML</refname> <refpurpose>Retourne une représentation XML du jeu de résultat</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>XML_sql2xml::getXML</function></funcdef> <paramdef> mixed <parameter><optional>$result = &null;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxml.desc"> &title.desc; <para> Retourne une chaîne XML avec une représentation XML du jeu de résultats. Le jeu de résultat peut être directement fournis ici ou bien, si vous avez besoin de plus d'un jeu dans votre Xml, alors, vous pouvez les fournir un par un avec la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>add</function></link> avant d'appeler <function>getXML</function>, mais le dernier peut également être fournis ici. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxml.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>mixed $result</parameter> - un obejt &class.db-result; depuis une requête &class.db; ou une requête SQL </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxml.return"> &title.returns; <para> <parameter>string</parameter> - la chaîne XML </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxml.note"> &title.note; ¬e.notstatic; <simpara></simpara> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathchildvalues.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathchildvalues.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathchildvalues.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues"> <refnamediv> <refname>XML_sql2xml::getXpathChildValues</refname> <refpurpose>retourne les tags fils qui correspondent à une expression XPath</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>XML_sql2xml::getXpathChildValues</function></funcdef> <paramdef> string <parameter>$expr</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.desc"> &title.desc; <para> Retourne les valeurs depuis les tags fils correspondant à la première correspondance avec une expression XPath. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $expr</parameter> - expression XPath </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.return"> &title.returns; <para> <parameter>array</parameter> - le contenu des tags fils. Le nom du tag fils est assigné à la clé, le contenu, à la valeur. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue"> <function>XML_sql2xml::getXpathValue</function> </link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathvalue.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathvalue.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/getxpathvalue.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue"> <refnamediv> <refname>XML_sql2xml::getXpathValue</refname> <refpurpose>retourne les correspondances à une expression XPath</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>XML_sql2xml::getXpathValue</function></funcdef> <paramdef> string <parameter>$expr</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.desc"> &title.desc; <para> Retourne le contenu de la première correspondance à uneexpression XPath. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $expr</parameter> - expression XPath </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.return"> &title.returns; <para> <parameter>mixed</parameter> - contenu de l'expression XPath évaluée </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues"> <function>XML_sql2xml::getXpathChildValues</function> </link> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setencoding.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setencoding.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setencoding.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.setencoding"> <refnamediv> <refname>XML_sql2xml::setEncoding</refname> <refpurpose>définie le jeu de caractères d'encodage</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::setEncoding</function></funcdef> <paramdef> string <parameter><optional>$encoding_from="ISO-8859-1"</optional></parameter> </paramdef> <paramdef> string <parameter><optional>$encoding_to="UTF-8"</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setencoding.desc"> &title.desc; <para> Définie le jeu de caractères d'encodage pour la transformation db2xml. La valeur <parameter>$encoding_from</parameter> dépend de votre système de base de données ; vérifiez le manuel DBMS pour connaître le jeu d'encodage utilisé par votre système pour les jeux de résultats. </para> <para> Le paramètre <parameter>$encoding_to</parameter> définie le jeu d'encodage pour le document XML créé. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setencoding.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $encoding_from</parameter> - encodage d'entrée </para> </listitem> <listitem> <para> <parameter>string $encoding_to</parameter> - encodage de sortie </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setencoding.note"> &title.note; ¬e.notstatic; <simpara></simpara> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setoptions.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setoptions.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setoptions.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.setoptions"> <refnamediv> <refname>XML_sql2xml::setOptions</refname> <refpurpose>définie les options pour l'instance</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::setOptions</function></funcdef> <paramdef> array <parameter>$options</parameter> </paramdef> <paramdef> constant <parameter><optional>$delete=&false;</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setoptions.desc"> &title.desc; <para> Cette méthode définie les options pour l'instance de la classe. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setoptions.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>array $options</parameter> - tableau d'options. Les clés du tableau définissent les options à définir. Les options disponibles sont : <itemizedlist> <listitem> <para>boolean <parameter>$options['nested']</parameter> - si &true;, le résultat d'une requête jointe sera traité normalement. Par défaut, &false;. </para> </listitem> <listitem> <para>boolean <parameter>$options['tagNameRow']</parameter> - nom pour le tag 'ligne'. Par défaut, <literal>row</literal>. </para> </listitem> <listitem> <para>boolean <parameter>$options['tagNameResult']</parameter> - nom pour le tag 'résultat'. Par défaut, <literal>result</literal>. </para> </listitem> </itemizedlist> </para> </listitem> <listitem> <para> <parameter>constant $delete</parameter> - les anciennes options doivent être effacées </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setoptions.note"> &title.note; ¬e.notstatic; <simpara></simpara> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setparenttables.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setparenttables.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/setparenttables.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables"> <refnamediv> <refname>XML_sql2xml::SetParentTables</refname> <refpurpose></refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::SetParentTables</function></funcdef> <paramdef> array <parameter>$parentTables</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.desc"> &title.desc; <para> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>array $parentTables</parameter> - relation parent à enfant </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.note"> &title.note; ¬e.notstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.see"> &title.see; <!-- Additional links go here --> <para> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.setparenttables.example"> &title.example; <example> <title>Utilisation de <function>SetParentTables</function></title> <programlisting role="php"> <![CDATA[ ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/xml-sql2xml.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/xml-sql2xml.xml +++ peardoc/fr/package/xml/xml-sql2xml/xml-sql2xml/xml-sql2xml.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml"> <refnamediv> <refname>XML_sql2xml::XML_sql2xml</refname> <refpurpose>Constructeur</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "XML/sql2xml.php"; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>XML_sql2xml::XML_sql2xml</function></funcdef> <paramdef> mixed <parameter><optional>$dsn = &null;</optional></parameter> </paramdef> <paramdef> string <parameter><optional>$root="root"</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.desc"> &title.desc; <para> Le constructeur peut prendre un objet Pear::DB <link linkend="package.database.db.intro-dsn">Data Source Name (DSN)</link> et donc, se connectera à la base de données ; ou un objet PEAR::DB, si vous vous êtes déjà connecté à la base de données. Fournir une chaîne SQL ne fonctionnera pas. </para> <para> Si vous fournissez uniquement un DSN, vous devez utiliser la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add">add</link> pour ajouter un objet &class.db-result;, une requête SQL ou un tableau plus tard. </para> <para> Le paramètre <parameter>$root</parameter> est utilisé si vous voulez fournir un autre nom pour le tag racine à la place de <literal>root</literal>. Si vous donnez une chaîne vide (''), il n'y aura pas de tag racine de créé ici, mais uniquement lorsque vous ajouterez un jeu de résultats, un tableau ou une requête SQL. Et ainsi, le premier tag de ce résultat sera utilisé comme élément racine. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>mixed $dsn</parameter> - PEAR::DB <literal>data source name</literal> ou un objet &class.db-common; </para> </listitem> <listitem> <para> <parameter>string $root</parameter> - le nom de l'élément racine XML. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.note"> &title.note; ¬e.canstatic; <simpara></simpara> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.see"> &title.see; <!-- Additional links go here --> <para> <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>XML_sql2xml::add</function></link> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml.example"> &title.example; <example> <title>Utilisation de <function>XML_sql2xml</function></title> <programlisting role="php"> <![CDATA[ $sql2xml = new xml_sql2xml("mysql://root@localhost/xmltest"); $sql2xml->Add("select * from bands"); ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/example.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/example.xml +++ peardoc/fr/package/xml/xml-sql2xml/example.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.example"> <refnamediv> <refname>Exemple(s)</refname> <refpurpose>Exemple(s)</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-sql2xml.example.example1"> <title></title> <para> Description d'exemple </para> <!-- the cdata section will formated "as is take care for tabulators --> <programlisting role="php"> <![CDATA[ ]]> </programlisting> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/intro-passing.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/intro-passing.xml +++ peardoc/fr/package/xml/xml-sql2xml/intro-passing.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.intro-passing"> <refnamediv> <refname>Introduction</refname> <refpurpose>Passer les données à transformer</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-sql2xml.intro-passing.overview"> <title>Vue d'ensemble</title> <para> Il y a trois façons de passer des données pour transformation à l'objet : <itemizedlist> <listitem> <para> <emphasis>avec une requête directe</emphasis> </para> <para> Cette façon a été détaillée dans la <link linkend="package.xml.xml-sql2xml.intro-simple">première partie</link> de l'introduction. </para> </listitem> <listitem> <para> <emphasis>avec un objet &class.db-result; existant</emphasis> </para> <para> Si vous avez besoin de l'API complète de <link linkend="package.database.db"><classname>PEAR::DB</classname></link> ou <classname>PEAR::MDB</classname>, vous devriez choisir cette façon. </para> </listitem> <listitem> <para> <emphasis>avec un tableau</emphasis> </para> <para> Ce n'est pas directement une transformation SQL en XML ; si vous passez un tableau indexé à l'instance, les clés du tableau seront transformées en tag XML et leurs valeurs seront placées dans le contenu du tag. Cette fonctionnalité vous aident à ajouter des données à un jeu de résultats transformés XML. </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-passing.query"> <title>Requête directe</title> <para> Ce comportement se connecte au DBMS, exécute la requête et traite le résultat automatiquement. <classname>XML_sql2xml</classname> requière un &intro.db-dsn; valide comme paramètre du <link linkend="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml">construteur</link>. La requête doit être passée à la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>getXML</function></link> ou <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>add</function></link>. </para> <para> Lisez la <link linkend="package.xml.xml-sql2xml.intro-simple">première partie</link> de l'introduction pour des exemples. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-passing.db-result"> <title>Passer un objet DB_Result</title> <para> <link linkend="package.database.db"><classname>PEAR::DB</classname></link> et <classname>PEAR::MDB</classname> retournent le jeu de résultats de la requête comme objet &class.db-result;. Vous devez fournir une instance &class.db-common; au <link linkend="package.xml.xml-sql2xml.xml-sql2xml.xml-sql2xml">construteur</link> et l'instance &class.db-result; à la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>getXML</function></link> ou <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>add</function></link>. </para> <example> <title>Passer un objet DB_Result</title> <programlisting role="php"> <![CDATA[ <?php require_once "XML/sql2xml.php"; require_once "DB.php"; $db = db::connect("mysql://username:password@localhost/xmltest"); $result = $db->query("select * from bands"); $sql2xmlclass = new xml_sql2xml($db); $xmlstring = $sql2xmlclass->getxml($result); ?> ]]> </programlisting> </example> <para> L'affichage XML dans le paramètre <parameter>$xmlstring</parameter> est égal à l'exemple dans <link linkend="package.xml.xml-sql2xml.intro-simple.simple"> "L'utilisation typique"</link>. </para> <para> Cette façon est la seule, si vous voulez bénéficier de toutes les fonctionnalités de l'APIs de la base de données. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-passing.array"> <title>Passer un tableau</title> <para> Si vous passez un tableau indexé à la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>getXML</function></link> ou <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>add</function></link>, il sera transformé en un document XML. </para> <example> <title>Passer un tableau</title> <programlisting role="php"> <![CDATA[ <?php require_once "XML/sql2xml.php"; $sql2xmlclass = new xml_sql2xml(); $array = array ( array("name"=>"The Blabbers", "birth_year"=>"1998", "birth_place"=>"London", "genre"=>"Rock'n'Roll"), array("name"=>"Only Stupids", "birth_year"=>"1997", "birth_place"=>"New York", "genre"=>"hiphop") ); $xmlstring = $sql2xmlclass->getXML($array); ?> ]]> </programlisting> <para>Le XML résultant dans le paramètre <parameter>$xmlstring</parameter> :</para> <programlisting role="php"> <![CDATA[ <?xml version="1.0"?> <root> <result> <row> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> </row> <row> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>hiphop</genre> </row> </result> </root> ]]> </programlisting> </example> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-passing.passcount"> <title>Passer plus d'un jeu de résultats</title> <para> Vous pouvez appeler la méthode <link linkend="package.xml.xml-sql2xml.xml-sql2xml.add"><function>add</function></link> pour ajouter des jeux de résultats à un document XML. Appeler juste la méthode pour chaque jeu de résultats ; si vous avez ajouté tous les jeux de résultats, appelez <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxml"><function>getXml</function></link> sans aucun argument pour récupérer le document XML. </para> <example> <title>Ajout de jeux de résultats</title> <programlisting role="php"> <![CDATA[ $sql2xmlclass->add("select * from bands"); $sql2xmlclass->add("select * from albums"); $xmlstring= $sql2xmlclass->getxml(); ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/intro-simple.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/intro-simple.xml +++ peardoc/fr/package/xml/xml-sql2xml/intro-simple.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.intro-simple"> <refnamediv> <refname>Introduction</refname> <refpurpose>Transformations simples</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-sql2xml.intro-simple.dbsample"> <title>Exemple de base de données</title> <para> Dans ce tutorial, les exemples réfèrent à cette table de base de données : <programlisting> <![CDATA[ mysql> select * from bands; +----+--------------+------------+-------------+-------------+ | id | name | birth_year | birth_place | genre | +----+--------------+------------+-------------+-------------+ | 1 | The Blabbers | 1998 | London | Rock'n'Roll | | 2 | Only Stupids | 1997 | New York | Hip Hop | +----+--------------+------------+-------------+-------------+ mysql> select * from albums; +----+---------+------------------+------+-----------------+ | id | bandsID | title | year | comment | +----+---------+------------------+------+-----------------+ | 1 | 1 | BlaBla | 1998 | Their first one | | 2 | 1 | More Talks | 2000 | The second one | | 3 | 2 | All your base... | 1999 | The Classic | +----+---------+------------------+------+-----------------+ ]]> </programlisting> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-simple.simple"> <title>L'utilisation typique</title> <para> Commençons par un exemple utilisant les options par défaut. La nouvelle instance est liée à un &intro.db-dsn;, donc, vous n'avez qu'à fournir une requête SQL. L'instance traite le résultat automatiquement ; dans le paramètre <parameter>$xmlstring</parameter>, vous trouvez la représentation XML du jeu de résultats. </para> <example> <title>Un exemple simple</title> <programlisting role="php"> <![CDATA[ <?php require_once "XML/sql2xml.php"; $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $xmlstring = $sql2xmlclass->getxml("select * from bands"); ?> ]]> </programlisting> <para> Le contenu du paramètre <parameter>$xmlstring</parameter> basé sur la table ci-dessus sera : </para> <programlisting> <![CDATA[ <?xml version="1.0"?> <root> <result> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> </row> <row> <id>2</id> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>Hip Hop</genre> </row> </result> </root> ]]> </programlisting> </example> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-simple.join"> <title>Transformation basé sur des jointures de requêtes</title> <para> Si le résultat de votre requête est basé sur des jointures de tables, une structure de données XML peut représenter comment le DBMS joint les tables. Pour activer ou désactiver ce comportement, utilisez <link linkend="package.xml.xml-sql2xml.xml-sql2xml.setoptions"> <function>setOptions</function></link> avec la clé option <parameter>'nested'</parameter>. La valeur par défaut est &true; - le comportement est activé. </para> <example> <title>Le jeu de résultats</title> <programlisting role="php"> <![CDATA[ <?php $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $xmlstring = $sql2xmlclass->getxml("select * from bands left join albums on bands.id = bandsID"); ?> ]]> </programlisting> <para> L'affichage XML généré dans <parameter>$xmlstring</parameter> : </para> <programlisting> <![CDATA[ <?xml version="1.0"?> <root> <result> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> <row> <id>1</id> <bandsID>1</bandsID> <title>BlaBla</title> <year>1998</year> <comment>Their first one</comment> </row> <row> <id>2</id> <bandsID>1</bandsID> <title>More Talks</title> <year>2000</year> <comment>The second one</comment> </row> </row> <row> <id>2</id> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>Hip Hop</genre> <row> <id>3</id> <bandsID>2</bandsID> <title>All your base...</title> <year>1999</year> <comment>The Classic</comment> </row> </row> </result> </root> ]]> </programlisting> </example> <para> Si vous désactivez ce comportement, la structure XML des lignes est plate. </para> <example> <title>Le jeu de résultats</title> <programlisting role="php"> <![CDATA[ <?php $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $options = array('nested' => false); $sql2xmlclass->setOptions($options); $xmlstring = $sql2xmlclass->getxml("select * from bands left join albums on bands.id = bandsID"); ?> ]]> </programlisting> <para> affichage XML : </para> <programlisting> <![CDATA[ $xmlstring => <?xml version="1.0"?> <root> <result> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> <id>1</id> <bandsID>1</bandsID> <title>BlaBla</title> <year>1998</year> <comment>Their first one</comment> </row> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> <id>2</id> <bandsID>1</bandsID> <title>More Talks</title> <year>2000</year> <comment>The second one</comment> </row> <row> <id>2</id> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>Hip Hop</genre> <id>3</id> <bandsID>2</bandsID> <title>All your base...</title> <year>1999</year> <comment>The Classic</comment> </row> </result> </root> ]]> </programlisting> </example> </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 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 --> http://cvs.php.net/co.php/peardoc/fr/package/xml/xml-sql2xml/intro-xpath.xml?r=1.1&p=1 Index: peardoc/fr/package/xml/xml-sql2xml/intro-xpath.xml +++ peardoc/fr/package/xml/xml-sql2xml/intro-xpath.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="package.xml.xml-sql2xml.intro-xpath"> <refnamediv> <refname>Introduction</refname> <refpurpose>Utilisation de XPath</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-sql2xml.intro-xpath.why"> <title>Que supporte XPath ?</title> <para> Le support de XPath a été introduit pour fournir un accès au jeu de résultats après avoir exécuté la requête SQL. Celà permet de traiter le jeu de résultats sans interroger de nouveau la base de données une fois de plus. </para> <para> XPath est un standard W3 et pour de plus amples informations concernant celà, lisez vos livres préférés XSL/XML ou <ulink url="&url.w3;">&url.w3;</ulink>. </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-xpath.getxpath"> <title>Passer une expression XPath</title> <para> <classname>XML_sql2xml</classname> fournit deux fonctions pour traiter le jeu de résultats : <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxpathvalue"> <function>getXpathValue</function></link> et <link linkend="package.xml.xml-sql2xml.xml-sql2xml.getxpathchildvalues"> <function>getXpathChildValues</function></link>. Les deux attendent une requête XPath et retournent le résultat en tant que chaîne de caractères ou de tableau. <example> <title>getXpathValue</title> <programlisting role="php"> <![CDATA[ <?php include_once("XML/sql2xml.php"); $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $sql2xmlclass->add("select * from bands"); $xmlstring = $sql2xmlclass->getXpathValue("/root/result/row[id = '2']/name"); ?> ]]> </programlisting> <para> <parameter>$xmlstring</parameter> contient : </para> <programlisting> <![CDATA[ $xmlstring = 'Only Stupids' ]]> </programlisting> </example> <example> <title>getXpathChildValues</title> <programlisting role="php"> <![CDATA[ <?php include_once("XML/sql2xml.php"); $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $sql2xmlclass->add("select * from bands"); $xmlstring = $sql2xmlclass->getXpathChildValues("/root/result/row[id = '2']"); ?> ]]> </programlisting> <para> <parameter>$xmlstring</parameter> contient : </para> <programlisting> <![CDATA[ Array ( [] => [id] => 2 [name] => Only Stupids [birth_year] => 1997 [birth_place] => New York [genre] => Hip Hop ) ]]> </programlisting> </example> </para> </refsect1> <refsect1 id="package.xml.xml-sql2xml.intro-xpath.mixsqlxpath"> <title>Mélanger les requêtes SQL et XPath</title> <para> Vous pouvez insérer une requête XPath dans une requête SQL. Dans cet exemple, une requête SQL est tout d'abord exécutée, puis, une autre requête SQL est exécutée - mais le paramètre pour <parameter>bandsID</parameter> est pris depuis une expression XPath dans les parenthèses. Cette expression est appliquée dans le jeu de résutat de la <emphasis>première</emphasis> requête SQL. </para> <example> <title>Requête mélangée</title> <programlisting role="php"> <![CDATA[ <?php include_once("XML/sql2xml.php"); $sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest"); $sql2xmlclass->add("select * from bands"); $sql2xmlclass->add("select * from albums where bandsID = {/root/result/row[name = 'The Blabbers']/id}"); $xmlstring = $sql2xmlclass->getxml(); ?> ]]> </programlisting> <programlisting> <![CDATA[ $xmlstring = ' <?xml version="1.0"?> <root> <result> <row> <id>1</id> <name>The Blabbers</name> <birth_year>1998</birth_year> <birth_place>London</birth_place> <genre>Rock'n'Roll</genre> </row> <row> <id>2</id> <name>Only Stupids</name> <birth_year>1997</birth_year> <birth_place>New York</birth_place> <genre>Hip Hop</genre> </row> </result> <result> <row> <id>1</id> <bandsID>1</bandsID> <title>BlaBla</title> <year>1998</year> <comment>Their first one</comment> </row> <row> <id>2</id> <bandsID>1</bandsID> <title>More Talks</title> <year>2000</year> <comment>The second one</comment> </row> </result> </root> ]]> </programlisting> </example> </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 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 -->