472,986 Members | 2,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

using <fo:page-number/> in <xsl:if test="">

Hello All,
I am trying to use the returned value of the <fo:page-number>
element/function in my <xsl:if> test condition. But am unsuccessful in
doing so. Is it possible to use it in this fashion with a conversion
or correct syntax? I would like to test the current page number and
see if it is even or odd - and if it is odd I would like to perform
additional steps. I would like to do something like this (assume all
namespaces are set):

<xsl:if test="<fo:page-number/>%2">
<xsl:text> Page </xsl:text> <fo:page-number/>
</xsl:test>

But of coarse the test condition does not want to deal with an
fo:function return value and I just want to do a Modulo of 2 to
determine if it is even or not.

Any help would be appreciated

Dec 2 '05 #1
3 14140
ok - typo in previous post - sorry :-(
code sample should be:

<xsl:if test="<fo:page-number/>%2">
<xsl:text> Page </xsl:text> <fo:page-number/>
</xsl:if>

Dec 2 '05 #2
I have been searching for a long time.
Did you ever find out how to test the value of fo:page-number?

I want to test to see if I'm on the last page of a document and then print a different footer.

I've tried everything I could think of and I've read everything I could find that sounded like it might have a solution.

I've been posting this:

Hello,

I was hoping you could help. I would love to see this in your FAQ's.

I want to test to see if I am on the last page of a document and when I am I want to print a different table in REGION AFTER.
I have tried many variations, no luck yet.

It seems like it should be an easy thing to do with xsl:choose.

Any ideas? Here is one of my attempts.

I am trying to test a field value in the footer area like this:

<xsl:choose>
<xsl:when test="document_end = 'TRUE'">
<fo:block font-size="10pt" font-weight="bold">
LAST PAGE
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block font-size="10pt" font-weight="bold">
not the last page
</fo:block>
</xsl:otherwise>
</xsl:choose>

I am trying to set the value of the field in the detail line loop
like this:

<xsl:if test="position() = last()">
<xsl:variable name="document_end" select="'TRUE'" />
</xsl:if>
More detail of what the xml, xsl and pdf look like are here:
http://www.bangboompow.com/xml/invoice/


All suggestions welcome.
Dennis
May 16 '06 #3
A working way to create a different footer for the last page of a document with xslt.

In the looping of the detail lines test for the last line and set a marker:

<xsl:choose>
<xsl:when test="position() = last()">
<fo:marker marker-class-name="footer-marker">
<fo:block>LAST PAGE</fo:block>
</fo:marker>
</xsl:when>
<xsl:otherwise>
<fo:marker marker-class-name="footer-marker">
<fo:block>Continued...</fo:block>
</fo:marker>
</xsl:otherwise>
</xsl:choose>

then retrieve the marker in the region-after with this:

<fo:retrieve-marker retrieve-position="last-ending-within-page" retrieve-class-name="footer-marker" />
May 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: blupp | last post by:
Hi, I am trying to install the package, but get the following error: cpan> install Date::Manip Running install for module Date::Manip Running make for S/SB/SBECK/DateManip-5.42a.tar.gz LWP...
5
by: Roger Leigh | last post by:
I've written a simple container template class to contain a single value. This emits a signal when the value is changed (it's used as a notifier of changes), and listeners can connect to its...
0
by: clécio | last post by:
Hi folks! i developed a web custom control inherited from webcontrol, but when i try to bound a property using <%= %>, i have all the code put between de ' ! ex.: <uc1:SkinControlManager...
1
by: Marc Boucher | last post by:
I'm using PG 7.3.4 I've a table with a column of type int8 where I store date-based values, and an index exists for it. The problem is that the index is almost never used with the '>' test. #...
6
by: Anthony Smith | last post by:
I can call a class using "->", but it complains about the :: I see on the net where :: is used. Is there a good explanation on when to use one over the other or the differences? $help = new...
15
by: arnuld | last post by:
-------- PROGRAMME ----------- /* Stroustrup, 5.6 Structures STATEMENT: this programmes *tries* to do do this in 3 parts: 1.) it creates a "struct", named "jd", of type "address". 2. it...
2
by: -Karl | last post by:
Couls someone please advise me on this error. What I am trying to do is be able to convert an XML document into arrays. I read that the subs & functions have to be in <scripttags. Thanks! ...
2
by: Sam | last post by:
Recently started using DB_DataObject with a Postgresql DB. Seems pretty nice, but I am not sure if insert() is supposed to be able to return the id of a recently returned object. It just seems to...
0
by: bizt | last post by:
Hi, When using the Save() and SaveXML() functions I am able to output xml on a screen or save to file. The only issue is that I would prefer to have it a bit more readable. For example: ...
4
by: Daryl Rubble | last post by:
I am trying to script a page on my IIS server running PHP, and every time i try to use the <? ?> in the script, it wont load it. Normal Page with NO error <?php echo"this is what is...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.