note 109220 deleted from function.spliti by danbrown
| From: | danbrown@php.net | Date: | Wed, 27 Jun 2012 16:35:15 +0000 |
| Subject: | note 109220 deleted from function.spliti by danbrown | ||
| References: | 1 | Groups: | php.notes php.notes |
| Request: | Send a blank email to php-notes+get-188925@lists.php.net to get a copy of this message | ||
Note Submitter: max dot mueller dot 65 at gmx dot de
----
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="von">0</xsl:param>
<xsl:param name="bis">9999</xsl:param>
<xsl:template match="/buchhandel">
<xsl:for-each-group
select="buch[(@ersch-jahr>$von)and(@ersch-jahr<$bis)]"
group-by="@ersch-jahr">
<xsl:sort select="@ersch-jahr"/>
<p>
<b><xsl:value-of select="current-grouping-key()"/></b><br/>
<xsl:for-each select="current-group()">
<xsl:value-of select="position()"/><xsl:text>.
</xsl:text><xsl:value-of select="buchtitel"/><br/>
</xsl:for-each>
</p>
</xsl:for-each-group>
</xsl:template>
<xsl:param name="ausrichtung">right</xsl:param>
<xsl:template match="/buchhandel">
<html><head><title>jop</title><style>.reisen {background-color:
green;}</style></head>
<body>
<xsl:apply-templates select="buch"/>
</body>
</html>
<xsl:apply-templates select="buch">
<xsl:sort select="preis" data-type="number"/>
</xsl:apply-templates>
<xsl:for-each select="buch">
<xsl:sort select="buchtitel" data-type="text"/>
<p><xsl:value-of select="buchtitel"/><xsl:text>
</xsl:text></p>
</xsl:for-each>
<xsl:for-each-group select="buch" group-by="buchverlag">
<p><b><xsl:value-of
select="current-grouping-key()"/></b></p>
<p><xsl:value-of select="current-group()/buchtitel" separator=",
"/></p>
</xsl:for-each-group>
</xsl:template>
<xsl:template match="buch">
<xsl:element name="p">
<xsl:attribute name="class" select="@kat" />
<xsl:value-of select="buchtitel"/><xsl:text> </xsl:text>
<xsl:value-of select="buchverlag"/><xsl:text> </xsl:text>
<xsl:value-of select="preis"/>
</xsl:element>
</xsl:template>
<xsl:template match="buch">
<p style="text-align:{$ausrichtung}">
<xsl:value-of select="buchtitel"/><xsl:text> </xsl:text>
<xsl:value-of select="buchverlag"/><xsl:text> </xsl:text>
<xsl:value-of select="preis"/>
</p>
</xsl:template>
<xsl:template match="buch">
<p>
<xsl:value-of select="buchtitel"/><xsl:text> </xsl:text>
<xsl:value-of select="buchverlag"/><xsl:text> </xsl:text>
<xsl:call-template name="preis_template">
<xsl:with-param name="preis" select="preis"/>
</xsl:call-template>
</p>
</xsl:template>
<xsl:template name="preis_template">
<xsl:param name="preis"/>
<xsl:choose>
<xsl:when test="preis/@waehrung='Dollar'">
<xsl:value-of select="format-number($preis*0.68054,'0.00')"/> EUR
(<xsl:value-of select="$preis"/> Dollar)
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$preis"/> EUR
</xsl:otherwise>
</xsl:choose>
</xsl:template>