[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] why no prev / next link
Hello, I have now this xslt : <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="../utilities/master.xsl"/> <xsl:import href="../utilities/dagboek-article.xsl"/> <xsl:param name="total_articles" select="data/dagboek/pagination/@total-entries" /> <xsl:param name="articles_per_page"> <xsl:choose> <xsl:when test="$page = 1 and $year = 2005 and $month = 04">1</xsl:when> <xsl:otherwise>3</xsl:otherwise> </xsl:choose> </xsl:param> <xsl:param name="number_pages"> <xsl:choose> <xsl:when test="$year = 2005 and $month = 04">3</xsl:when> <xsl:otherwise> <xsl:value-of select="ceiling($total_articles div $articles_per_page)" /> </xsl:otherwise> </xsl:choose> </xsl:param> <xsl:param name="offset"> <xsl:choose> <xsl:when test="$page = 1 and $year = 2005 and $month = 04">0</xsl:when> <xsl:when test="$page > 1 and $year = 2005"><xsl:value-of select="($page - 1)* $articles_per_page -2" /> </xsl:when> <xsl:otherwise> <xsl:value-of select="$articles_per_page * $page - $articles_per_page " /> </xsl:otherwise> </xsl:choose> </xsl:param> <xsl:param name="end" select="$offset + $articles_per_page + 1" /> <xsl:template match="data"> <xsl:if test=" $page <= $number_pages " > <xsl:apply-templates select="dagboek/entry[position() > $offset][position() < $end]" /> <xsl:if test="number_pages > 1"> <div class="post-nav"> <xsl:choose> <xsl:when test=" $page > 1" > <span class="previous"><a href="{$root}/dagboek/{$year}/{$month}/{$page - 1} ">prev</a> </span> </xsl:when> <xsl:when test="$page < number_pages" > <span class="next"> <a href="{$root}/dagboek/{$year}/{$month}/{$page + 1}">next </a> </span> </xsl:when> </xsl:choose> </div> </xsl:if> </xsl:if> <xsl:if test=" $page > $number_pages " > <xsl:call-template name="error" /> </xsl:if> </xsl:template> </xsl:stylesheet> But when the variable page has the value 1 and number_pages has the value 3 I expected that a next link would appear but it don't appear. Can anyone help me figure out why not ? Roelof
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|