English | Français | >> Deutsch << | Magyar | 中文 | Polski | ZVON > Tutorials > XSLT Tutorial |
Intro / Suchen / ZVON |
>> Seite 23 << | Zurück | Vor | Inhalt | Element-Index |
XML Quelltext
<source> <color>blue</color> <color>navy</color> <color>green</color> <color>lime</color> <color>red</color> </source> Ausgabe
<TABLE> <TR> <TD style="color:blue">blue</TD> </TR> </TABLE> <TABLE> <TR> <TD style="color:navy">navy</TD> </TR> </TABLE> <TABLE> <TR> <TD style="color:green">green</TD> </TR> </TABLE> <TABLE> <TR> <TD style="color:lime">lime</TD> </TR> </TABLE> <TABLE> <TR> <TD style="color:red">red</TD> </TR> </TABLE> HTML-Ansicht
|
XSLT Stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:template match="color"> <TABLE> <TR> <TD> <xsl:attribute name="style"> <xsl:text>color:</xsl:text> <xsl:value-of select="."/> </xsl:attribute> <xsl:value-of select="."/> </TD> </TR> </TABLE> </xsl:template> </xsl:stylesheet> |