Here's as close as I could get:
1) Create template.xpgt with this content (adapted from the ADE "best practices" code--my selection code is a little simpler):
<!-- list of page master definitions -->
<fo:region-body margin-top="1.5em" margin-bottom="1.5em"/>
<!-- page master selection -->
<!-- dynamic styling rules -->
<ade:styling-rule selector=".header" display="adobe-other-region" adobe-region="xsl-region-before"/>
<ade:styling-rule selector=".footer" display="adobe-other-region" adobe-region="xsl-region-after"/>
2) Add the template to the manifest:
<item id="template" href="template.xpgt" media-type="application/adobe-page-template+xml" />
3) Link to the selector logic through CSS definitions in style.css:
4) Invoke all this machinery with code in the xhtml file:
<p class="header">Jane Austen—Pride and Prejudice</p>
<p class="footer">Chapter 1</p>
<h1 style="page-break-before:auto" id="toc-anchor-Chapter-1">Chapter 1</h1>
<p>It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife.</p>
Here is what works:
a) All the pages in the book are created with reserved space at the top and bottom per region-before and region-after up in 1) above.
b) The first page of text generated from this code has the header and footer in those reserved spaces. Thanks to the layout in "em" terms, it all scales nicely at different reader size settings.
Here is what doesn't work:
c) No other pages will have the header and footer text. If I add the same header and footer declarations later in the text, the page output for that point in the text will also have the header and footer. However, it clearly isn't possible to scatter hundreds of these through the text to make sure that all pages end up with header and footer text!
As far as I can tell, this is exactly "by design". In the world of XSL-FO, a flow of text into any of the five regions is only intended to be presented on one page. The mechanism XSL-FO provides for recycling text from one page to the next is <fo:static-content .... />, either with fixed text, with text that contains pre-defined running values like page #, or with a marker that can be redefined at will by additional directives in the text ("running headers")
The ADE "best practices" docs and samples don't show how to add static-content elements to the XSL; these elements are supposed to occur in the scope of a <fo
age-sequence ... /> element . I've tried a number of variants for adding these elements to the template file, but most of them hung or crashed both ADE and the Sony reader software. If they ran at all, I didn't get the expected static text appearing in the header or footer space. I suspect that the XSL parser in ADE et al only supports a subset of XSL-FO.
I'm about ready to give up on this; my remaining hopes:
A) I haven't yet tried adding XSL-FO directly to the xhtml file to see if that works any better.
B) Someone with better understanding of XSL-FO may have other suggestions.
C) If anyone has seen an epub book with chapter headers, it should be easy to reverse engineer.
However, as pointed out earlier in this thread, the XSL-FO approach Adobe has provided runs against the grain of the standard. Since the best reason for switching from LRF to epub is to get something that will reliably deploy cross-platform, I'd hate to spend a lot of time ironing out the kinks here, only to have to replace them 6-12 months from now. So I'd appreciate any help or insights you or anyone else has, but I'm also hoping that anything we find is easy to swap out.
Thanks for any help!