Help with printing a fixed header and footer?

W

will

Dear All, can anyone help here?

I need to use XML/XSLT to print out some documents which must all have
the same letterhead and footer section on all pages. The section in
between is dynamic XML, and will be of variable length.

Is it possible in XSLT to specify that this section must appear on
every page in this position?

And what is the best strategy for specifying that the variable XML
data between the header and footer must automatically roll on to
another sheet if necessary?

If anyone could give me a rough idea of whether this is possible, or
could point me in the direction of something on the web that deals
with this challenge, I'd be grateful. I'm pretty new to this stuff.

Thank you.

Will
 
M

Mathieu CARTOIXA

Hi,

If you need to stick with XSLT, then you will have to transform your XML
data into HTML pages, and use a CSS2 compliant to get them printed with the
layout you want. The way to create headers and footers in HTML pages with
CSS2 is explained in the CSS2 Specification (http://www.w3.org/TR/REC-CSS2),
chapter 9.6.1.
If you can use XSL (XSLT + XSL-FO) (http://www.w3.org/TR/xsl), you will
have a much better control of the rendering and create headers and footers
at your will (see chapter 6.4).

Hope this helps.
Mac
 
A

Andy Fish

XSLT is not a page layout language, it's purely an XML transformation
language, so it depends what output format you are going to generate.

If you're thinking of outputting HTML or plain text and working out where
the end of a page would be, forget it, certainly with XSLT. If you're
outputting plain text and can bank on the same number of lines each page,
write a post-process (not XSL) which counts the lines and puts the footers
on. For HTML you're screwed because it's the rendering engine that decides
how big various fonts are and how much to put on a page.

I would suggest you generate RTF or FO. These have the concept of footer so
you can just specify the footer and leave the page formatting to the
subsequent layout process. AFAIK HTML does not have the concept of a page
header or footer.

Andy
 
M

Mathieu CARTOIXA

Hi,

In this case, all you need is (in HTML, with a compatible browser) to
define a THEAD and a TFOOTER section in your TABLE. If you will use plain
XML, see CSS2 (http://www.w3.org/TR/REC-CSS2), chapter 17.2.
Please note that your table must NOT have the "layout" property set to
"fixed"...
Mac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top