|
<?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"/>
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Element: <xsl:otherwise>
/ Beispiel 01</TITLE>
</HEAD>
<BODY>
<xsl:apply-templates select="shop"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="shop">
<TABLE BORDER="1">
<TR>
<TH WIDTH="150">Artikel:</TH>
<TH WIDTH="150">Auswahl:</TH>
<TH WIDTH="100">Preis:</TH>
</TR>
<xsl:apply-templates select="order/product"/>
</TABLE>
</xsl:template>
<xsl:template match="product">
<TR>
<TD><xsl:value-of select="name"/></TD>
<TD ALIGN="RIGHT">
<xsl:for-each select="variation/color">
<xsl:if test="@selected='true'">
<xsl:choose>
<xsl:when test="@name='yellow'">
<xsl:text>gelb</xsl:text>
</xsl:when>
<xsl:when test="@name='red'">
<xsl:text>rot</xsl:text>
</xsl:when>
<xsl:when test="@name='blue'">
<xsl:text>blau</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</TD>
<TD ALIGN="RIGHT">
<xsl:value-of select="price"/>
<xsl:text> </xsl:text>
<xsl:value-of select="currency"/>
</TD>
</TR>
</xsl:template>
</xsl:stylesheet>
|