[XSL-LIST Mailing List Archive Home]
Re: [xsl] XSL - suppression of page header for first page of report
Subject: Re: [xsl] XSL - suppression of page header for first page of report|
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 08 Sep 2010 21:42:39 -0400
At 2010-09-08 21:31 -0400, David Dunkenberger wrote:
I am using an expression to display the current page number in the page
[expression : currentPage()]
I'm not sure which language you are using with that function call,
but you are in a situation where you need to test some condition of
the *interpretation* of your result while you are in the
transformation of the data that is producing your result.
It can't be done that way ... XSLT is at arm's length from the system
that is interpreting the result of your XSLT.
I need to have some information print in the page header, but I don't want
it to show on the first page, just every subsequent page.
When using XSL-FO, this is accomplished with a page-sequence-master
that sequences a page header without a page number on the first page
of the page sequence, followed by a page header with a page number on
every other page of the page sequence. Then the transformation is
declarative and blissfully unaware of the interpretation of its
result: it simply sequences the page headers as desired and lets the
XSL-FO processor worry about rendering one of the two kinds of
headers on the pages.
I tried to use an xsl:if test"currentPage()= 0", but that isn't working.
Right ... because XSLT is going from XML to your rendering language,
and the knowledge that the page is at the beginning is known only to
your rendering language renderer. When using XSL-FO that is the
XSL-FO engine, which knows nothing and has no feedback loop to the XSLT engine.
there another way or better way to suppress information printing in the page
header for the first page only?
Depends on which rendering language you are using. "currentPage()"
isn't a function of XSL-FO or any rendering language I know, so I
can't advise specifically. Look for a way that your rendering
language supports two kinds of headers, or perhaps your rendering
language has an expression language of its own. For example, though
it doesn't work with page numbers, you can express arithmetic
calculations in XSL-FO attributes for the XSL-FO engine to resolve,
not having to have the XSLT processor resolving them. Sadly, page
numbers are not available operands in XSL-FO's expression language,
and the expression language is only arithmetic and does not have conditionals.
I hope this helps.
. . . . . . . . . Ken
XSLT/XQuery training: after http://XMLPrague.cz 2011-03-28/04-01
Vote for your XML training: http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal