initial translation

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@156338 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Damien Seguy 2004-04-16 18:49:27 +00:00
parent 945c876b07
commit c151c218ae

View file

@ -0,0 +1,140 @@
<?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
-->