I have a small problem implementing the suggested customization for glossdiv in mode=toc (question 2 in original post). My customization (1.75.2 with FOP) produces the correct output (a TOC with one line for each glossdiv in the glossary "A............"). The problem is that I get *no page number* at the end of each line. The lines are produced by calling the stock toc.line (fo/autotoc.xsl) template with the glossdiv as param. It seems like fo:page-number-citation outputs an empty string. All glossdivs have an xml:id attribute and I've verified that $id has the correct value when used as ref-id.
Suggestions? Best regards, Bergfrid Skaara On Thu, Jul 23, 2009 at 7:08 AM, Bob Stayton <[email protected]> wrote: > Some answers below, prefaced by "BOB:". > Other answers may follow as time and research permit. > > > Bob Stayton > Sagehill Enterprises > [email protected] > > > ----- Original Message ----- From: Bergfrid Skaara > > To: [email protected] > Sent: Monday, July 20, 2009 1:47 AM > Subject: [docbook-apps] customizing glossaries (as list, FO output) > > > > Hi, I'm having multiple customiztion problems related to glossaries in FO > output: > > 1. I've set the glossary.sort parameter to 1, but I would like space and > hypens to be ignored when sorting (so that you get ca, car, ca-range and > not > ca, ca-range, car). I've looked at the normalize.sort.input and > normalize.sort.output gentext templates (en-US), but I can't see how > changing them will give the desired result. > > 2. In our standalone glossary, the root element is book, directly followed > by an info element and then the glossary itself (which has glossdivs and > xincludes from modular files). Now, the TOC contains one entry, "Glossary", > and the PDF bookmarks are "Table of Contents" and "Glossary". I would like > to replace entries saying "Glossary" with a list of glossdivs (the title is > the letters a-z), is this possible? > > BOB: TOC entries are generated by processing document nodes in mode="toc". > The default template in that mode for glossary just outputs the "Glossary" > line. Customize this template: > > <xsl:template match="bibliography|glossary" > mode="toc"> > > so that it does xsl:apply-templates mode="toc" to its children, and then > add > templates in that mode for the children. If this is too brief an > explanation, > please ask for details. > > > 3. Some glossentries have multiple glossdefs; is it possible to > automatically enumerate the glossdefs for such entries? If yes, which > templates must be overridden? > > BOB: Customize this template from fo/glossary.xsl: > > <xsl:template match="glossentry/glossdef" mode="glossary.as.list"> > > and possibly also this one if you want to use a nested fo:list-block for > multiple entries: > > <xsl:template match="glossentry" mode="glossary.as.list"> > > The match="glossentry" template must generate the fo:list-block, and the > template for each glossdef should generate each fo:list-item. > > > 4. Some time ago, I posted a message about modular glossaries in which we > replace the otherterm attributes with xlink:href attributes (sorry, I can't > find the post). The suggested customization (from Bob) was for glosseealso > elements. I've since then tried to use the same pattern for glossee > elements, and ran into problems with the "See" gentext". With glosseealso, > "See also" is correctly inserted at the beginning of the line before the > links, but with glossee I do not get the "See" gentext before the link. > Which template calls the gentext in these cases? > > 5. Is there an easy way to override text alignment just for glossaries? > I've > currently copied the template matching d:glsosdiv in mode glossary.as.list > to add text-align parameter to teh fo:list-block . It would be nice if > there > were something like the attribute set for indexes: index.entry.properties. > > Working with stylesheets 1.75.1 > > BOB: Starting with 1.75.0, some attribute-sets were added to control > formatting of the glossary entries: > > > http://docbook.sourceforge.net/release/xsl/current/doc/fo/glossterm.list.properties.html > > http://docbook.sourceforge.net/release/xsl/current/doc/fo/glossdef.list.properties.html > > http://docbook.sourceforge.net/release/xsl/current/doc/fo/glossterm.block.properties.html > > http://docbook.sourceforge.net/release/xsl/current/doc/fo/glossdef.block.properties.html > > > > Best regards, > Bergfrid Skaara > >
