Připravujeme ...
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" encoding="UTF-8" /> <xsl:template match="/"> <xsl:if test="not(data/item = '')"> <xsl:call-template name="paging" /> <div class="section-products"> <xsl:for-each select="data/item"> <xsl:call-template name="products" /> </xsl:for-each> </div> <xsl:call-template name="paging" /> </xsl:if> </xsl:template> <!-- Zobrazeni jedne polozky zbozi ============================= --> <xsl:template name="products"> <div class="span3"> <div class="product"> <a> <xsl:attribute name="href"><xsl:value-of select="product_url" /></xsl:attribute> <img style="width: 160px;"> <xsl:attribute name="alt"><xsl:value-of select="name" /></xsl:attribute> <xsl:attribute name="src"><xsl:value-of select="images/medium" /></xsl:attribute> </img> </a> <div class="name"> <a> <xsl:attribute name="href"><xsl:value-of select="product_url" /></xsl:attribute> <xsl:value-of select="name" /> <xsl:text> </xsl:text> </a> </div> <div class="price"> <p> <xsl:value-of select="price_final/price_final" /> <xsl:if test="price_final/discount_int>0"> (<span class="strike"><xsl:value-of select="price_final/price" /></span>) </xsl:if> </p> </div> <div class="addcart"> <a class="btn"> <xsl:attribute name="href"><xsl:value-of select="product_url" /></xsl:attribute> <xsl:value-of select="//app_texts/detail" /> </a> </div> <ul class="special"> <xsl:if test="new > 0" > <li class="special-new"><span><xsl:value-of select="//app_texts/new" /></span></li> </xsl:if> <xsl:if test="sale > 0" > <li class="special-sale"><span><xsl:value-of select="//app_texts/sale" /></span></li> </xsl:if> <xsl:if test="special_offer > 0" > <li class="special-offer"><span><xsl:value-of select="//app_texts/special_offer" /></span></li> </xsl:if> </ul> </div> </div> </xsl:template> <xsl:template name="paging"> <xsl:if test="count(//paging) > 1"> <div class="shop-paging"> <xsl:for-each select="//paging" > <a> <xsl:attribute name="href"><xsl:value-of select="url" /></xsl:attribute> <xsl:if test="actual=1"> <xsl:attribute name="class">active</xsl:attribute> </xsl:if> <xsl:value-of select="page" /> </a> </xsl:for-each> </div> </xsl:if> </xsl:template> </xsl:stylesheet>
Vyzkoušejte si službu nezávazně na 30 dní zdarma.