Skip to content

Instantly share code, notes, and snippets.

@brablc
Created December 10, 2016 13:29
Show Gist options
  • Save brablc/4253916368024ea09cf0bb3c888de84c to your computer and use it in GitHub Desktop.
Save brablc/4253916368024ea09cf0bb3c888de84c to your computer and use it in GitHub Desktop.
Shoptet Katalog XML Stylesheet
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="html"
version="4.01"
encoding="utf-8"
indent="yes"
omit-xml-declaration="yes"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
<xsl:template match="/">
<html>
<head>
<title>Katalog</title>
</head>
<body>
<table>
<xsl:for-each select="SHOP/*">
<xsl:call-template name="shopitem" />
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<xsl:template name="shopitem" match="SHOPITEM">
<tr>
<td>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="./IMGURL" />
</xsl:attribute>
<xsl:attribute name="height">120</xsl:attribute>
</xsl:element>
</td>
<td>
<xsl:value-of select="./ITEM_ID" />
</td>
<td>
<xsl:value-of select="./PRODUCT_NAME" />
</td>
<td>
<xsl:value-of select="./DESCRIPTION" />
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment