Help with printing a fixed header and footer?

Will (21)

Usenet Archive
Joined
Aug 6, 2003
Messages
3
Reaction score
0
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
 

Mathieu CARTOIXA

Usenet Archive
Joined
Jul 17, 2003
Messages
8
Reaction score
0
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
 

Andy Fish

Usenet Archive
Joined
Dec 30, 2002
Messages
605
Reaction score
0
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
 

Will (21)

Usenet Archive
Joined
Aug 6, 2003
Messages
3
Reaction score
0
(will) wrote:
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?
...

Just a little clarification. The XSLT creates HTML which is then viewed in a browser and printed by the user. My XSLT currently outputs tables of a set height to match the A4 page size. This works fine if the XML data in the centre of the document is a small volume. But if there is a lot of XML data, the current footer will get pushed down the page onto the next printed sheet, so I need a way to fix the footer to each page, and have the XML data text flowing round it (and round the header on the next page).

Thank you, Will
 

Mathieu CARTOIXA

Usenet Archive
Joined
Jul 17, 2003
Messages
8
Reaction score
0
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

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top