On 08.04.2006 14:44:38 Pierre-Henri Kraus wrote: > Hello, > I've been trying for 2 weeks to solve the page-number-citation-last > problem with a page-sequence id (page-position="last") but in vain :( > Do you have any pointer of where i should resolve the id and if it needs > new data structure in the existing classes ? > I've tried to resolve the number in "finishPageSequence()" as we need to > know how much pages there is in the page sequence to reference it, and > to add a List containing the PageNumberCitationLastResolver but it > doesn't work. > Sorry for disturbing you but the academic year is coming to its end, and > as i have a lot of work with my courses i fear i won't be able to finish > it all if i don't advance fast enough.
The first step to make this work is to move the addIDToPage() call from activateLayout() to makeNewPage() so the ID is added to each page generated by the page-sequence. That solves the problem for trivial page-sequences with no forced page breaks. But as soon as forced page breaks are involved the PNCL-LM thinks it can resolve the ID and does so, even though the page-sequence hasn't finished generating pages. So you're right that we need to keep track of formatting objects which have an "id" attribute and have not finished contributing content to the document. I think this is not something that applies to only page-sequence but to every formatting object that has an "id" attribute. Here's what I think should work: PSLM.addIDToPage should add each ID it receives to a list (actually a java.util.Set) on the AreaTreeHandler. That keeps track of which formatting objects contribute IDs. Then, each layout manager should notify the AreaTreeHandler when all areas for a formatting object have been generated (addAreas() stage). The trick here is probably to know when exactly that is. That may not be trivial. The AreaTreeHandler can then remove the ID from the tracking list. This tracking list can then be used by the PNCL-LM to help decide whether an ID can already be resolved or not. I hope that helps you in your quest. BTW, some feedback on your patch: - Please make sure your Java editor doesn't produce TAB characters. - Please try to make PageNumberCitationLast a subclass of PageNumberCitation to reduce redundancy. The same should be done for the respective layout manager. > PS : I've just faxed the ICLA, i hope you received it well. Thanks, I'll let you know as soon as it is recorded. Jeremias Maerki