You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by brycenesbitt <br...@obviously.com> on 2007/03/18 02:31:54 UTC
How to use in ? Eg. "if page == 1".
Can anyone help with this? I'm trying to print an address element only on
the first page of a document:
<fo:static-content flow-name="xsl-region-before">
<fo:block font-weight="bold"
Invoice page <fo:page-number/>
</fo:block>
<xsl:if test="fo:page-number = 1">
<xsl:call-template name="address" />
</xsl:if>
</fo:static-content>
The page number prints correctly, but the xsl:if is always false. I've
tried a lot of googling, but even seemingly on-point posts such as
http://www.dpawson.co.uk/xsl/sect3/N8703.html don't work with my fop 0.20.5
--
View this message in context: http://www.nabble.com/How-to-use-%3Cfo%3Apage-number-%3E-in-%3Cxsl%3Aif%3E---Eg.-%22if-page-%3D%3D-1%22.-tf3421094.html#a9535255
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: How to use in ? Eg. "if page == 1".
Posted by Abel Braaksma <ab...@xs4all.nl>.
Andreas L Delmelle wrote:
>
>> I've tried a lot of googling, but even seemingly on-point posts such as
>> http://www.dpawson.co.uk/xsl/sect3/N8703.html
>
> Hmm, that last one is very dubious to say the least...
>
It says the same as you do, yet in other words: "The page layout is
carried out by the formatter, hence the page number is not available at
the transform stage". The xslt example in that last post if of the OP,
not from D. Tolpin who answered (but its html format is a bit unclear, yes).
-- Abel
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: How to use in ? Eg. "if page == 1".
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Mar 18, 2007, at 02:31, brycenesbitt wrote:
Hi,
> Can anyone help with this? I'm trying to print an address element
> only on
> the first page of a document:
> <snip />
> The page number prints correctly, but the xsl:if is always false.
Yes, because the processing actually is performed in two stages: XSLT
+ FO.
The xsl:if gets resolved by the XSLT processor and your source XML
does not contain a fo:page-number element, hence why the test is
false. Even if it could see that fo:page-number element /in/ the
stylesheet, it doesn't know yet what value the FO processor will
assign to it.
> I've tried a lot of googling, but even seemingly on-point posts
> such as
> http://www.dpawson.co.uk/xsl/sect3/N8703.html
Hmm, that last one is very dubious to say the least...
What you need is roughly described here:
http://xmlgraphics.apache.org/fop/fo.html#fo-first-page
HTH!
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org