dams Fri Apr 16 14:49:27 2004 EDT Added files: /phpdoc/en/reference/xsl/functions reference.xml Log: initial translation
http://cvs.php.net/co.php/phpdoc/en/reference/xsl/functions/reference.xml?r=1.1&p=1 Index: phpdoc/en/reference/xsl/functions/reference.xml +++ phpdoc/en/reference/xsl/functions/reference.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.xsl"> <title>XSL</title> <titleabbrev>XSL</titleabbrev> <partintro> <section id="xsl.intro"> &reftitle.intro; &warn.experimental; <para> L'extension XSL implémente le standard XSL, et fait des transformations XSLT à l'aide de la librairie libxslt. </para> </section> <section id="xsl.installation"> &reftitle.install; <para> &php; 5 inclut l'exntesion XSL par défaut, et elle peut être activée en ajoutant l'option à votre ligne de commande, lors de la compilation de &php;. <literal>DIR</literal> est le dossier d'installation de libxslt. </para> </section> <section id="xsl.examples"> &reftitle.examples; <para> Dans cet exemple d'introduction, nous allons apprendre comment transformer un document XML en un document HTML. </para> <para> <example> <title>Un arbre XSL simple</title> <programlisting role="xml"> <![CDATA[ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="iso-8859-1" indent="no"/> <xsl:template match="collection"> Hey! Welcome to my sweet CD collection! <xsl:apply-templates/> </xsl:template> <xsl:template match="cd"> <h1><xsl:value-of select="title"/></h1> <h2>by <xsl:value-of select="artist"/></h2> <h3> - <xsl:value-of select="year"/></h3> </xsl:template> </xsl:stylesheet> ]]> </programlisting> </example> <example> <title>L'arbre XML correspondant</title> <programlisting role="xml"> <![CDATA[ <collection> <cd> <title>PHP Rock</title> <artist>Joe Coder</artist> <year>2003</year> </cd> <cd> <title>Squashing Typos on a Winter's Eve</title> <artist>kennyt</artist> <year>2004</year> </cd> </collection> ]]> </programlisting> </example> </section> <example> <title>Transformation de XML en HTML</title> <simpara> Le code &php; suivant utilise les extensions XML et XSL pour transformer le code XML en du code HTML présentable. </simpara> <programlisting role="php"> <![CDATA[ <?php /* Chargement des sources XML */ $xml = new DomDocument; // dans /ext/dom $xml->load('example.xml'); $xsl = new DomDocument; $xsl->load('example.xsl'); /* Configuration du transformateur */ $proc = new xsltprocessor; $proc->importStyleSheet($xsl); // Importation des règles XSL echo $proc->transformToXML($xml); // Transformation ?> ]]> </programlisting> <simpara> Cela doit produire le code HTML suivant : </simpara> <screen> <![CDATA[ Hey! Welcome to my sweet CD collection! <h1>PHP Rock</h1> <h2>by Joe Coder</h2> <h3> - 2003</h3> <h1>Squashing Typos on a Winter's Eve</h1> <h2> by kennyt</h2> <h3> - 2004</h3> ]]> </screen> </example> </section> </partintro> &reference.xsl.functions; </reference> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->