Custom Record 7.4" Example
A 7.4" example using a custom record
- Template: templates/custom3.xsl
- Record: records/coolpix.xml
Custom Record 7.4" Example (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="maxProperties"
select="8"
>
</xsl:variable>
<xsl:variable name="maxSpecifications"
select="7"
>
</xsl:variable>
<image height="800"
width="480"
>
<field height="22"
width="480"
x="0"
y="30"
>
<text align="center"
font-family="Verdana"
font-size="18"
text-decoration="underline"
>
<xsl:value-of select="Article/Category"
>
</xsl:value-of>
</text>
</field>
<field height="36"
width="480"
x="0"
y="65"
>
<text align="center"
font-family="Verdana"
font-size="30"
font-weight="bold"
>
<utils method="toUpperCase"
>
<xsl:value-of select="Article/Manufacturer"
>
</xsl:value-of>
</utils>
</text>
</field>
<field height="60"
width="450"
x="15"
y="110"
>
<text align="center"
font-family="Verdana"
font-size="24"
>
<xsl:value-of select="Article/Name"
>
</xsl:value-of>
</text>
</field>
<field height="400"
width="450"
x="15"
y="175"
>
<text align="center"
font-family="Tahoma"
font-size="15"
font-weight="bold"
>
<ul spacing="0"
type=""
>
<xsl:for-each select="Article/Properties/Field"
>
<li>
<xsl:value-of select="."
>
</xsl:value-of>
</li>
</xsl:for-each>
</ul>
</text>
<text align="left"
font-family="Tahoma"
font-size="18"
font-weight="normal"
padding-left="5"
padding-top="20"
>
<ul spacing="0"
type=""
>
<xsl:for-each select="Article/Specification/Field"
>
<li>
<xsl:value-of select="."
>
</xsl:value-of>
</li>
</xsl:for-each>
</ul>
</text>
</field>
<xsl:choose>
<xsl:when test="number(substring-before($price, ',')) < 100"
>
<xsl:choose>
<xsl:when test="substring-after($price,',') = '00'"
>
<field height="205"
width="410"
x="10"
y="570"
>
<text align="right"
font-family="Tahoma"
font-size="170"
font-style="italic"
font-weight="bold"
>
<xsl:value-of select="substring-before($price,',')"
>
</xsl:value-of>
</text>
</field>
</xsl:when>
<xsl:otherwise>
<field height="205"
width="330"
x="10"
y="570"
>
<text align="right"
font-family="Tahoma"
font-size="170"
font-style="italic"
font-weight="bold"
>
<xsl:value-of select="substring-before($price,',')"
>
</xsl:value-of>
</text>
</field>
<field height="157"
width="120"
x="320"
y="570"
>
<text font-family="Tahoma"
font-size="85"
font-style="italic"
font-weight="bold"
>
<xsl:value-of select="substring-after($price,',')"
>
</xsl:value-of>
</text>
</field>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="number(substring-before($price, ',')) < 1000"
>
<xsl:choose>
<xsl:when test="substring-after($price,',') = '00'"
>
<field height="157"
width="415"
x="10"
y="600"
>
<text align="right"
font-family="Tahoma"
font-size="130"
font-style="italic"
font-weight="bold"
>
<xsl:value-of select="substring-before($price,',')"
>
</xsl:value-of>
</text>
</field>
</xsl:when>
<xsl:otherwise>
<field height="157"
width="340"
x="10"
y="600"
>
<text align="right"
font-family="Tahoma"
font-size="130"
font-style="italic"
font-weight="bold"
>
<xsl:value-of select="substring-before($price,',')"
>
</xsl:value-of>
</text>
</field>
<field height="157"
width="100"
x="340"
y="600"
>
<text font-family="Tahoma"
font-size="70"
font-style="italic"
font-weight="bold"
>
<xsl:value-of select="substring-after($price,',')"
>
</xsl:value-of>
</text>
</field>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="number(substring-before($price, ',')) < 10000"
>
<xsl:choose>
<xsl:when test="substring-after($price,',') = '00'"
>
<field height="157"
width="435"
x="10"
y="600"
>
<text align="right"
font-family="Tahoma"
font-size="110"
font-style="italic"
font-weight="bold"
>
<xsl:value-of select="substring-before($price,',')"
>
</xsl:value-of>
</text>
</field>
</xsl:when>
<xsl:otherwise>
<field height="157"
width="370"
x="00"
y="600"
>
<text align="right"
font-family="Tahoma"
font-size="110"
font-style="italic"
font-weight="bold"
>
<xsl:value-of select="substring-before($price,',')"
>
</xsl:value-of>
</text>
</field>
<field height="157"
width="100"
x="360"
y="600"
>
<text font-family="Tahoma"
font-size="55"
font-style="italic"
font-weight="bold"
>
<xsl:value-of select="substring-after($price,',')"
>
</xsl:value-of>
</text>
</field>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
<field align="left"
height="12"
width="100"
x="15"
y="780"
>
<barcode humanReadableEnabled="false"
type="code128"
>
<xsl:value-of select="Article/ArticleNumber"
>
</xsl:value-of>
</barcode>
</field>
<field height="17"
width="80"
x="120"
y="778"
>
<text font-family="Tahoma"
font-size="14"
>
<xsl:value-of select="Article/ArticleNumber"
>
</xsl:value-of>
</text>
</field>
<field align="right"
height="12"
width="150"
x="315"
y="780"
>
<barcode humanReadableEnabled="false"
type="code128"
>
<xsl:value-of select="Label/Id"
>
</xsl:value-of>
</barcode>
</field>
</image>
</xsl:template>
</xsl:stylesheet>
Custom Record 7.4" Example (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
Execution Status
Execution Problem |
---|
Textfield is empty (max. width: 450, max. height: 400) |