[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] force pagebreaks in a glossary
Hi Tom, The parameters are set using the --stringparam option to xsltproc. See this reference on using parameters: http://www.sagehill.net/docbookxsl/Parameters.html And there was a typo in my example. It should have been: <xsl:when test="parent::glossary and $glossary.as.blocks = 0"> But if you manage to set glossary.as.blocks to 1, then you won't need the customization. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "Tom Peters" <tpeters@xs4all.nl> To: "docbook-apps" <docbook-apps@lists.oasis-open.org> Sent: Friday, May 06, 2005 6:08 AM Subject: Re: [docbook-apps] force pagebreaks in a glossary > On Thu, 5 May 2005, Bob Stayton wrote: > > Thanx for your suggestions; > > > I'm assuming you are using FOP, > > Yes > > > and that the <?pagebreak?> processing > > instruction outputs an emtpy fo:block with a break-before="page" property, > > right? > > I wouldn't know. Automatically generated .fo files are unreadable (at > least by me). > > > > The reason this doesn't work in a glossary is because the default formatting > > for a glossary uses an fo:list-block, with a fo:list-item for each entry. > > XSL-FO does not support putting an fo:block as a sibling of fo:list-item, so > > it is being ignored (it should be flagged as an error, actually). You will > > have the same problem if you try to use it between DocBook listitem elements > > in a list. > > > > The simplest solution would be to set $glossary.as.block to 1, then the > > output would be a sequence of fo:block elements instead of fo:list-items in > > a fo:list-block container. Then your empty fo:block would fit in between > > entries. > > Exactly what do you mean with "set $glossary.as.block to 1", and where > should I do that? I ask because this is what I tried and it does not make > a difference: > > xsltproc -o Glos.fo --stringparam paper.type A4 --param simplesect.in.toc > 0 --param glossary.as.block 1 printglos.xsl Glos.tmp > fop Glos.fo Glos.pdf > > > > But if you don't like how that looks, you could make the template that > > processes the processing instruction context sensitive, and change what it > > outputs. For a glossary formatted as a list, you would need to output an > > empty fo:list-item, as follows: > > > > <xsl:choose> > > <xsl:when test="parent::glossary" and $glossary.as.blocks = 0"> > > <fo:list-item break-before="page"> > > <fo:list-item-label><fo:block/></fo:list-item-label> > > <fo:list-item-body><fo:block/></fo:list-item-body> > > </fo:list-item> > > </xsl:when> > > <xsl:otherwise> > > <fo:block break-before="page"/> > > </xsl:otherwise> > > </xsl:choose> > > When I put the code you provided above in a pre-processing .xsl (which > otherwise automatically adds an <indexterm> stanza after each <glossterm>) > and call it with this command: > > xsltproc -o Glos.tmp --param glossary.as.block 0 add-indexterms-glos.xsl > Glos.xml > > Then I get error messages like these: > > add-indexterms-glos.xsl:43: parser error : Specification mandate value for > attribute and <xsl:when test="parent::glossary" and $glossary.as.blocks = > 0"> > > When I leave out the '$' before glossary.as.blocks, then I get the same > error message. > > So where should I put that code and how should I provide > glossary.as.blocks ? > > Thanx for your interest, > -- > #>!$!%(@^%#%*(&(#@#*$^@^$##*#@&(%)@**$!(&!^(#((#&%!)%*@)(&$($$%(@#)&*!^$)^@* ^@) > > Tom Peters > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org > > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]