# Image Rendering Reference

## Navigation:

Index General Information Elements Utils Examples

## Custom Record 4.41" Example With List

A 4.41" example using a custom record representing elements in a floating list

- Template: templates/custom2.xsl
- Record: records/coolpix.xml

## Custom Record 4.41" Example With List (Template)

<xsl:stylesheet version="2.0" >
<xsl:template match="Record" >
<xsl:variable name="price" >
<xsl:value-of select="translate(Article/Price,'.','')" >
</xsl:value-of>
</xsl:variable>
<xsl:variable name="maxElements" select="7" >
</xsl:variable>
<xsl:variable name="propertiesCount" >
<xsl:choose>
<xsl:when test="Article/Properties/Field[1] != ''" >
<xsl:value-of select="count(Article/Properties/Field)" >
</xsl:value-of>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="specificationsCount" >
<xsl:choose>
<xsl:when test="Article/Specification/Field[1] != ''" >
<xsl:value-of select="count(Article/Specification/Field)" >
</xsl:value-of>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="totalCount" select="$propertiesCount + $specificationsCount" >
</xsl:variable>
<image height="300" width="400" >
<field height="20" width="400" x="0" y="8" >
<text align="center" font-family="Tahoma" font-size="14" font-weight="bold" text-decoration="underline" >
<xsl:value-of select="Article/Category" >
</xsl:value-of>
</text>
</field>
<field height="27" width="400" x="0" y="28" >
<text align="center" font-family="Verdana" font-size="22" font-weight="bold" >
<utils method="toUpperCase" >
<xsl:value-of select="Article/Manufacturer" >
</xsl:value-of>
</utils>
</text>
</field>
<field height="48" width="390" x="5" y="54" >
<text align="center" font-family="Verdana" font-size="18" >
<xsl:value-of select="Article/Name" >
</xsl:value-of>
</text>
</field>
<field height="80" width="390" x="5" y="103" >
<text align="center" font-family="Tahoma" font-size="15,13" >
<ul float="true" type="disc" >
<xsl:if test="Article/Properties/Field[1] != ''" >
<xsl:for-each select="Article/Properties/Field" >
<li>
<xsl:value-of select="." >
</xsl:value-of>
</li>
</xsl:for-each>
</xsl:if>
<xsl:if test="Article/Specification/Field[1] != ''" >
<xsl:for-each select="Article/Specification/Field" >
<li>
<xsl:value-of select="." >
</xsl:value-of>
</li>
</xsl:for-each>
</xsl:if>
</ul>
</text>
</field>
<xsl:choose>
<xsl:when test="substring-after($price,',') = '00'" >
<field height="87" width="390" x="5" y="185" >
<text align="right" font-family="Tahoma" font-size="80" font-style="italic" font-weight="bold" >
<xsl:value-of select="substring-before($price,',')" >
</xsl:value-of>
</text>
</field>
</xsl:when>
<xsl:otherwise>
<field height="97" width="335" x="5" y="185" >
<text align="right" font-family="Tahoma" font-size="80" font-style="italic" font-weight="bold" >
<xsl:value-of select="substring-before($price,',')" >
</xsl:value-of>
</text>
</field>
<field align="left" height="87" width="65" x="330" y="190" >
<text font-family="Tahoma" font-size="40" font-style="italic" font-weight="bold" >
<xsl:value-of select="substring-after($price,',')" >
</xsl:value-of>
</text>
</field>
</xsl:otherwise>
</xsl:choose>
<field height="10" width="98" x="6" y="287" >
<barcode humanReadableEnabled="false" type="code128" >
<xsl:value-of select="Article/ArticleNumber" >
</xsl:value-of>
</barcode>
</field>
<field height="14" width="60" x="110" y="286" >
<text font-family="Tahoma" font-size="12" >
<xsl:value-of select="Article/ArticleNumber" >
</xsl:value-of>
</text>
</field>
<field align="right" height="10" width="180" x="212" y="287" >
<barcode humanReadableEnabled="false" type="code128" >
<xsl:value-of select="Label/Id" >
</xsl:value-of>
</barcode>
</field>
</image>
</xsl:template>
</xsl:stylesheet>

## Custom Record 4.41" Example With List (Record)

<Article>
<ArticleNumber>
1183821
</ArticleNumber>
<Name>
Coolpix S9200 Silber
</Name>
<Manufacturer>
Nikon
</Manufacturer>
<Category>
Digitalkamera
</Category>
<Price>
129,90
</Price>
<Specification>
<Field>
Fotoauflösung: 16 Megapixel max.
</Field>
<Field>
Zoom-Bereich: 25 bis 450 mm
</Field>
<Field>
Speichermedium: SD/SDHC/SDXC
</Field>
<Field>
Mögliche Dateiformate: JPEG, MOV, MPEG4
</Field>
<Field>
Videoauflösung: 1980 x 1080 Pixel
</Field>
<Field>
Zoomfaktor: 18-fach
</Field>
<Field>
optischer Bildstabilisator
</Field>
<Field>
Lichtstärke: F 1:3,5 bis 5,9
</Field>
<Field>
Lichtempfindlichkeit: 3200 ISO
</Field>
</Specification>
<Packaging>
<Item>
Trageschlaufe
</Item>
<Item>
USB-Kabel
</Item>
<Item>
Netzadapter
</Item>
</Packaging>
<Accessories>
<Item>
Akku EN-EL12
</Item>
<Item>
SDHC-Karte
</Item>
</Accessories>
</Article>

## Generated Image