Subject: Re: [xsl] Hello - how do I use the count function properly? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 20 Sep 2010 12:11:03 -0400 |
<xsl:template match="category"> <xsl:for-each select="child::category"> <div class="cat_module"> <xsl:if test="position() mod 4 = 0"> <xsl:attribute name="style"> <xsl:text>margin-right: 0px !important</xsl:text> </xsl:attribute> </xsl:if> <h2> <a href="{descendant::link}"> <xsl:value-of select="@display_name"/> <img src="{descendant::image}" alt=""/> </a> </h2> <a href="{descendant::link}"> <span>Shop Now</span> </a> </div> </xsl:for-each> </xsl:template>
Cheers, Wendell
<xsl:template match="category"> <xsl:for-each select="child::category"> <xsl:choose> <xsl:when test="count(/child::category)=4 or count(/child::category)=8"> <div class="cat_module" style="margin-right: 0px !important"> <h2> <a href="{descendant::link}"> <xsl:value-of select="@display_name"/> <img src="{descendant::image}" alt=""/> </a> </h2> <a href="{descendant::link}"> <span>Shop Now</span> </a> </div> </xsl:when> <xsl:otherwise> <div class="cat_module"> <h2> <a href="{descendant::link}"> <xsl:value-of select="@display_name"/> <img src="{descendant::image}" alt=""/> </a> </h2> <a href="{descendant::link}"> <span>Shop Now</span> </a> </div> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:template>
Dan Acuff
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Hello - how do I use the , Dan Acuff | Thread | [xsl] commenting Parent element onl, pankaj . c |
RE: [xsl] Hello - how do I use the , Dan Acuff | Date | [xsl] Reranging Numbers, Jeff Sese |
Month |