Subject: Re: [xsl] why no prev / next link From: Michel Hendriksen <michel.hendriksen@xxxxx> Date: Fri, 13 Jan 2012 10:27:14 +0100 |
You forgot $ in "$page < number_pages" Michel On 1/13/12, Roelof Wobben <rwobben@xxxxxxxxxxx> wrote: > > > 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] why no prev / next link, Roelof Wobben | Thread | RE: [xsl] why no prev / next link, Roelof Wobben |
[xsl] [XSLFO] empty flow on even pa, Geert Bormans | Date | Re: [xsl] [XSLFO] empty flow on eve, Marc |
Month |