|
Subject: Re: [xsl] Counting Nodes Based on Conditional Statements From: Geert Josten <Geert.Josten@xxxxxxxxxxx> Date: Sat, 30 Oct 2004 17:36:35 +0200 |
<xsl:template match="/"> <div class="line"></div>
<xsl:for-each select="catalog/category/topic/book">
<xsl:sort select="title" data-type="text" order="ascending" />
<xsl:if test="$status = 'All' or ($status = 'Purchased' and @status = 'Purchased')">
<xsl:if test="$category = 'All' or ($category = ../../@name and ($topic = ../@name or $topic = 'All'))">
<div><xsl:value-of select="title" /></div>
<div class="line"></div>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
<xsl:variable
name="books"
select="catalog/category/topic/book
[$status = 'All'
or ($status = 'Purchased' and @status = 'Purchased')]
[$category = 'All'
or ($category = ../../@name and ($topic = ../@name or $topic = 'All'))]" /><xsl:choose>
<xsl:when test="count($books) = 0">
<!-- sorry no books -->
</xsl:when>
<xsl:otherwise>
<!-- count($books) shown! -->
<xsl:for-each select="$books">
<!-- presentation of books -->
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>Grtz, Geert
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Counting Nodes Based on Condi, Michael | Thread | [xsl] XPath Error, Dharm Baval |
| RE: [xsl] XPath Error, Michael Kay | Date | Re: [xsl] XPath Error, Geert Josten |
| Month |