xsl-list
[Top] [All Lists]

Re: [xsl] XSL - suppression of page header for first page of report

2010-09-08 20:42:56
At 2010-09-08 21:31 -0400, David Dunkenberger wrote:
I am using an expression to display the current page number in the page
footer.
[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.

Is
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(_at_)CraneSoftwrights(_dot_)com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>