Hi Folks:
I've been looking the archives but didn't found any thread about it.
I've also checked Dave's FAQ.
I'm writing a stylesheet to generate presentations in HTML.
I've wrote two named templates called "find.nextslide" and
"find.lastslide" to generate a link to
those slides (that appears on top left of present slide).
My problem is who can I compare the $next variable, which
is the position of actual "<slide>" element plus 1, and
$last variable. If $next > $last so $result = $last else
$result = $next.
I've tried many "test" attribute of <xsl:when> element, like:
test="$next > $last"
I was not really sure if $next and $last were number value or
string, so I tried:
test="number($next) > number($last)"
test="$next > number($last)"
My XSLT processor, xsltproc (v. 1.1.3), complains:
xmlXPathCompOpEval: parameter error
runtime error: file xpresent-common.xsl line 98 element value-of
xsltValueOf: text copy failed
line 98 is:
<xsl:value-of select="concat('slide',$result,'.html')"/>
of "find.nextslide" named template.
Am I messing things up? I really can't figure out...
Any ideas?
here goes both templates:
<!-- returns the last slide number -->
<xsl:template name="find.lastslide">
<xsl:value-of select="count(/xpresent/slide)"/>
</xsl:template>
<!-- creates an "slideX.html" string -->
<xsl:template name="find.nextslide">
<xsl:variable name="next" select="position() + 1"/>
<xsl:variable name="last"><xsl:call-template
name="find.lastslide"/></xsl:variable>
<xsl:choose>
<xsl:when test="$next > $last">
<xsl:variable name="result"><xsl:value-of
select="$last"/></xsl:variable>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="result"><xsl:value-of
select="$next"/></xsl:variable>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="concat('slide',$result,'.html')"/>
</xsl:template>
thanks a lot in advance!!!
--
[]'s
Lucas Brasilino
brasilino(_at_)recife(_dot_)pe(_dot_)gov(_dot_)br
http://www.recife.pe.gov.br
Emprel - Empresa Municipal de Informatica (pt_BR)
Municipal Computing Enterprise (en_US)
Recife - Pernambuco - Brasil
Fone: +55-81-34167078