xsl
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | xsl [2011/03/04 17:58] (current) – created ginko | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== XSL ====== | ||
| + | eXtensible Stylesheet Language. | ||
| + | Un langage de transformation de documents XML. | ||
| + | |||
| + | ===== Exemples ===== | ||
| + | ==== Affichage d'un document XML (en HTML) ==== | ||
| + | Un petit document XSL pour visualiser un document XML sous forme de document HTML: | ||
| + | <code xml><? | ||
| + | < | ||
| + | <!-- Main --> | ||
| + | < | ||
| + | <html xmlns=" | ||
| + | < | ||
| + | < | ||
| + | <link rel=" | ||
| + | </ | ||
| + | < | ||
| + | <!-- Go! --> | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | <!-- Versatile template (recursive) --> | ||
| + | < | ||
| + | <!-- Grab current element' | ||
| + | < | ||
| + | <!-- Build a div for each element with the element name as class name --> | ||
| + | <div class=" | ||
| + | <!-- Print the element name as a label followed by corresponding value --> | ||
| + | <span class=" | ||
| + | <!-- If current node has a child, recurse! --> | ||
| + | <xsl:if test=" | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | Ce code récursif est versatile : il est capable d' | ||
| + | |||
| + | Il est possible d' | ||
| + | === Pistes d' | ||
| + | * Afficher les attributs | ||
| + | * Calculer le niveau de récursion afin d' | ||
xsl.txt · Last modified: 2011/03/04 17:58 by ginko
