Currently I have some xml documents which are converted via xsl into html. The html is converted via abcpdf into a pdf document. The content of the pages is dynamic. A page is represented by a div tag, however the amount of content going in could in fact be 3 pages long & I need some pages to have a header and a footer inserted and some not, so if a div tag has 3 pages worth of content, that means 3 headers and 3 footers inserting.
Also as the content is dynamic,page 10 may have no footer or header, however once the logic of the application has ran through a 2nd time page 10 could in fact be page 20.
I am looking for a solution which uses css to add the headers and footers conditionally. Its easy to use XSL to add them but as a div can contain up to 3 pages worth of content I need a way of adding the headers and footers (or possibly not) in all 3 pages contained within a div.
I have looked at css pagination, but not sure if this is the right solution.
Any ideas would be greatfully received