xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cinzia" <cinzia...@dsl.pipex.com>
Subject Re: guide me
Date Sat, 08 Apr 2006 23:58:43 GMT
>From an efficiency point of view, wouldn't it be better to have a select
(that filters odd elements) in the xsl:apply-templates so that the second
template "gets called" 1/2 the total number of cityInstal?

<xsl:apply-templates select="cityInstal[position() mod 2 = 1]"/> <!-- p.s.
remove xsl:if in the other template -->

Jus a note on xslt processor. I have tried the code below out of curiosity,
and I cannot explain why, but position() always returns 2, which results in
an empty table-body, as the xsl:if fails. (Used: saxonb 8, fop 0.20.5, j2se
1.4.2, winxp pro).

Cinzia

>   <xsl:template match="genericSiteDoc">
>     <xsl:apply-templates />
>   </xsl:template>
>
>   <xsl:template match="cityInstal">
>     <xsl:if test="position() mod 2 =1">
>       <fo:table-row>
>       <fo:table-cell><fo:block><xsl:value-of select="."
/></fo:block></fo:table-cell>
>       <fo:table-cell><fo:block><xsl:value-of
select="following-sibling::cityInstal[1]" /></fo:block></fo:table-cell>
>       </fo:table-row>
>     </xsl:if>
>   </xsl:template>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message