Privacy Policy Cookie Policy Terms and Conditions

[HOME PAGE] [STORES] [CLASSICISTRANIERI.COM] [FOTO] [YOUTUBE CHANNEL]


Extensible Stylesheet Language Transformations

Extensible Stylesheet Language Transformations

XSL Transformations
Extension .xsl, .xslt
Type MIME application/xslt+xml[1]
Développé par World Wide Web Consortium
Type de format Langage de feuille de style
Extension du XML
Standard(s) 1.0 (Recommandation du 16 novembre 1999),

2.0 (Recommandation du 23 janvier 2007)

XSLT (eXtensible Stylesheet Language Transformations), défini au sein de la recommandation XSL du W3C, est un langage de transformation XML de type fonctionnel. Il permet notamment de transformer un document XML dans un autre format, tel PDF ou encore HTML pour être affiché comme une page web.

Description

Les flux d'une transformation XSLT.

L'objectif principal est la transformation d'un document XML vers un autre schema ou format (XHTML, XSL-FO, HTML, etc.). Cependant, le langage XSLT permet aussi les transformations vers tout autre type de document, au format texte ou dans un format binaire (bien que ceci ne soit pas nativement prévu par la recommandation XSLT). Étant donné deux entrées, un document XML à transformer et un document XSLT, un analyseur XSLT (XSLT processor) produit un fichier de sortie au format désiré.

XSLT s'appuie sur XPath (une autre partie de la recommandation XSL) pour désigner une partie d'un arbre XML. En pratique, le langage XSLT est lui-même exprimé sous forme de document XML :

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" indent="yes"/>

<xsl:template match="person">
    <name username="{@username}">
       <xsl:value-of select="name" />
    </name>
</xsl:template>

</xsl:stylesheet>

L'une de ses principales particularités est d'être centré sur les données. Un XSLT doit s'appuyer sur un XML, c'est un couple obligatoire, et on ne peut créer en XSLT que des boucles parcourant des données sélectionnées par XPath.

Exemple

Fichier XML d'entrée

<?xml version="1.0" ?>
<persons>
  <person username="JS1">
    <name>John</name>
    <family-name>Smith</family-name>
  </person>
  <person username="MI1">
    <name>Morka</name>
    <family-name>Ismincius</family-name>
  </person>
</persons>
+

Feuille de style XSLT

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>
 
  <xsl:template match="/persons">
    <root>
      <xsl:apply-templates select="person"/>
    </root>
  </xsl:template>
 
  <xsl:template match="person">
    <name username="{@username}">
      <xsl:value-of select="name" />
    </name>
  </xsl:template>
</xsl:stylesheet>

Fichier XML résultat

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <name username="JS1">John</name>
  <name username="MI1">Morka</name>
</root>

Implémentations d'analyseurs XSLT

  • AltovaXML : par Altova, implémentation gratuite de XSLT 1.0 et XSLT 2.0
  • DIXml : une bibliothèque Delphi
  • Gestalt : par Colin Paul Adams, implémentation en Eiffel de XSLT 2.0
  • Libxslt (en) : par GNOME, implémentation en C de XSLT 1.0
  • MSXML DOM : par Microsoft pour une utilisation en DCOM sous Windows et donc accessible aux langages de script tel vbScript et jScript
  • php_xsl.dll : inclus depuis PHP 5[2]
  • QuiXSLT : par Innovimax et INRIA en Java pour XSLT 3.0 avec Streaming[3]
  • Saxon XSLT (en) : par Michael Kay, Saxon existe en Java pour XSLT 1.0 et en Java et .Net pour XSLT 2.0 (avec validation de XML Schema)
  • System.Xml.Xsl : en parallèle par Microsoft et Novell pour les différentes implémentation du Framework .NET
  • Xalan (en) : par la fondation Apache, existe en Java, C et Perl et gère XSLT 1.0

Voir aussi

Articles connexes

  • XPath
  • XQuery
  • XML
  • XSL | XSL-FO
  • HTML
  • SGML
  • XHTML

Références

  1. XSL Transformations (XSLT) Version 2.0
  2. http://www.php.net/manual/fr/book.xsl.php
  3. https://project.inria.fr/quix-tool-suite/quixslt/

Liens externes

  • (en) La recommandation W3C XSLT 1.0 du 16 novembre 1999 et
    • (fr) Traduction française de la recommandation
  • (en) La recommandation W3C XSLT 2.0 du 23 janvier 2007


  • Portail de la programmation informatique
This article is issued from Wikipédia - version of the Wednesday, January 14, 2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.
Contents Listing Alphabetical by Author:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Unknown Other

Contents Listing Alphabetical by Title:
# A B C D E F G H I J K L M N O P Q R S T U V W Y Z Other

Medical Encyclopedia

Browse by first letter of topic:


A-Ag Ah-Ap Aq-Az B-Bk Bl-Bz C-Cg Ch-Co
Cp-Cz D-Di Dj-Dz E-Ep Eq-Ez F G
H-Hf Hg-Hz I-In Io-Iz J K L-Ln
Lo-Lz M-Mf Mg-Mz N O P-Pl Pm-Pz
Q R S-Sh Si-Sp Sq-Sz T-Tn To-Tz
U V W X Y Z 0-9

Biblioteca - SPANISH

Biblioteca Solidaria - SPANISH

Bugzilla

Ebooks Gratuits

Encyclopaedia Britannica 1911 - PDF

Project Gutenberg: DVD-ROM 2007

Project Gutenberg ENGLISH Selection

Project Gutenberg SPANISH Selection

Standard E-books

Wikipedia Articles Indexes

Wikipedia for Schools - ENGLISH

Wikipedia for Schools - FRENCH

Wikipedia for Schools - SPANISH

Wikipedia for Schools - PORTUGUESE

Wikipedia 2016 - FRENCH

Wikipedia HTML - CATALAN

Wikipedia Picture of the Year 2006

Wikipedia Picture of the Year 2007

Wikipedia Picture of the Year 2008

Wikipedia Picture of the Year 2009

Wikipedia Picture of the Year 2010

Wikipedia Picture of the Year 2011