L'élément <xsl:copy-of> permet de recopier les noeuds sélectionnés par le pattern dans l'arbre du document XML résultant.
Les attributs :<xsl:copy-of select="pattern"/>
Elément | Description |
---|---|
select="pattern" | permet de sélectionner par une expression des noeuds. |
Cet élément peut être contenu dans les instructions suivantes :
Cet élément ne peut contenir aucunes instructions.
Exemple : [voir]<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" media-type="text/html; charset=ISO-8859-1"/> <xsl:variable name="entete"> <tr> <th style="text-align:left">Editeur</th> <th>Langue</th> <th>OS</th> </tr> </xsl:variable> <xsl:template match="/"> <html> <body> <xsl:for-each select="logitheque/categorie/logiciel"> <h1> <xsl:value-of select="nom"/> </h1> <table border="1"> <xsl:copy-of select="$entete"/> <tr> <td> <a href="{editeur/@lien}" target="_blank"> <xsl:value-of select="editeur"/> </a> </td> <td> <xsl:value-of select="langue"/> </td> <td> <xsl:value-of select="plateforme"/> </td> </tr> </table> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> |