I now have teiJournal-to-NLM motoring along quite well; I've got all the way through handling body elements, as far as I can tell. Next I'll try bulk-converting the whole set of articles and bug-fixing on those, before I move on to the difficult issue of the reference list and appendices.
Added some of the basic body block-level element handling. I was able to take advantage of some of the XHTML processing already written to deal with tables, because NLM purports to use the XHTML table model, but there are still apparently some issues; <caption> seems to require another block-level element below it, and the @class attribute is not supported. Still, we're making progress.
The latest version of the schema generated from my ODD file now allows <pb> tags, which I can now use for forcing page-breaks in PDFs. It also includes a recent P5 fix, brought about by LR, which allows the @type attribute on <biblStruct> elements. I've been using @rend, because it was the best of many bad options, but @type is exactly what I need, so I've changed all the XML data and the reference rendering code so that it now uses @type instead of @rend.
In the process, I took another look at the PDF rendering, and decided that the first page template looked a bit odd, with no footer, and a large bottom margin. I've now extended the page, and added the normal recto footer, and it looks a lot better. This re-paginated all the documents, so I had to do more PDF fixes with <pb>.
The editors' intros are due soon, and then this issue should go out. I need to decide whether PDF links should be on the contents page, as well as on the actual XHTML version of the document. I think probably they should, but I'll check with the editors.
The page break thing is now working. It's a kludge, but it'll do until we can move to a newer version of FOP.
It occurred to me that I could make judicious use of a little hack element such as:
<pb type="fopFix" />
to force pagebreaks where our ancient version of FOP is not able to provide them. Having written the necessary code -- to process the element in the PDF output, and to suppress it in the XHTML -- I found one example in our current data of a heading at the bottom of a page (Conclusions, in the McIntosh paper), and started trying to add the pb, only to discover that I'd deleted it from the schema through my ODD file. Having remedied that, I now find that ROMA isn't able to produce schemas -- it seems to be unresponsive and/or broken, and produces only empty files, where it produces anything at all. I guess I'll come back to this tomorrow.
Embarcadero/CodeGear are hosting an online "CodeRage" conference with live presentations using MS Live Meeting, all week, presenting new features in Delphi 2009. This is important stuff, because D2009 now has full, core Unicode support. I've tuned in and out of four presentations during the day, and the best have been the afternoon sessions on Unicode and the RTL features. D2009 is probably going to be the basis for the next generation of the Image Markup Tool. There's no sign of academic pricing for D2009, though; I'm waiting for CodeGear's response to my query about this.
Began work on the NLM output for teiJournal, which will tie it into OJS. The metadata is basically done, and validates; it takes the <teiHeader> and converts it into the NLM <front> element. So far so good, but I am noticing that there is some information that really ought to be in my teiJournal structure, but which isn't, as yet, because IALLT has not required it. For instance, there should be provision for an abstract, which in NLM belongs in the metadata area. This conversion work will give me some clearer ideas about how to fill out the teiJournal tagset and encoding practices.
Based on some editorial feedback from HM, I've reduced the size of the images on the page to 4" wide (discovering in the process that FOP 0.20.5 doesn't support content-width, but if you just set width, it does scale the content proportionately). I also increased the space between the footer top border and the text above to a quarter of an inch.
Then I tackled endnote numbers, discovering that if you set the font size, that seems to undermine the application of the vertical-align and/or baseline-shift properties, so I've left the font size for endnote numbers in the text as default, and now I have superscripting. The link is also working, although FOP's positioning of the hot area is always slightly off. I fixed a bug that was causing all in-text footnote numbers to be "1" (xsl:number never does quite what you expect). Finally, I noticed a situation in which a URL was not having zero-width wrapping spaces inserted, and it turned out to be because it starts with https, and I was crudely trapping for http://. I'm now just looking for http, which should do the job. We may have to complicate it a bit for ftp and other protocols at some stage, but you don't see them as much as you used to.
I've now added a PDF link to the document XHTML output, so all articles are available as PDF.
Finally got the tables to display according to APA guidelines. It appears that borders only work reliably on table cells, and you can only get them to display different top/bottom from right/left borders by explicitly specifying every style, width and colour for the borders. It was setting the right/left borders to white that finally "suppressed" them. For the bottom border of the table, I had to add a bottom border to cells in the final row.
I then trimmed the space-after attribute for all headings, resulting in text that looked better -- it appears you want gaps between sections, but not between headings and their following paragraphs -- and virtually no instances of widows (which is luck, but the odds are better when there's a smaller space-after).
As far as I can see, I have only one remaining problem: I simply can't find a way to make footnote numbers appear superscripted in the text. According to the FOP compliance table, it should support baseline-shift: super, but it just doesn't work; and vertical-align, which should also be able to take a value of super, fails too. There may be some combination of settings I can use to make it function; I'll need to experiment.
Got the endnotes working properly, with somewhat simpler code than I used in ScanCan. Also managed to fix the basic-link to internal-destination problem; links within the document now work.
After that, I started work on tables. This is not simple, because the styling requirements for tables in APA are quite unusual and quite strict; you need to have top and bottom borders on tables and label rows, but no borders on cells, and no vertical borders at all. I have what I think is basically the right xsl:fo code going into FOP, but right now it's failing to do right by my borders. I'll have to hack around at it a bit more, but I may end up having to compromised and just go for a straight grid table.