[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] page headers for <article><section>
Hi Ron, The problem seems to be the last line of this: > <fo:retrieve-marker > retrieve-class-name="section.head.marker" > retrieve-position="first-including-carryover" > retrieve-boundary="page-sequence"/> > <xsl:apply-templates select="." mode="title.markup"/> The header.content template is processed in the context of the element generating the page sequence. In this case, the article is the context element. So select="." means selecting the article and generating its title. If you delete that line, then the retrieve-marker is left to produce the section title. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "Ron Catterall" <ron@catterall.net> To: <docbook-apps@lists.oasis-open.org> Sent: Monday, September 03, 2007 1:07 PM Subject: [docbook-apps] page headers for <article><section> > Hi > > I'm having problems trying to get article title as header on even > pages and section title as header on odd pages for a very simple > simple document (an article built out of sections and appendices) > (DB5, 1.73.2, Saxon 6.5.5, XEP4.9). A simplified version of the xml > and xsl files is below. Files to generate sufficient pages to > demonstrate the problem are attached: test.xml and test.xsl and the > pdf output, test.pdf > > (For a book everything works fine as in Bob's book pp.196-7.) > > The header on the odd pages (centered of course) is: > Title of first sectionTitleof article > (i.e. a concatenation of the correct section and article titles) and so > on: > Title of second sectionTitle of article. > etc > The header on the even pages is correct: > Title of article > and as expected > > Replacing the <retrieve-marker>/<apply-templates> section by: > <xsl:value-of > select="ancestor-or-self::d:article/d:section/d:info/d:title"/> > results in picking up the title of the first section and using that > for ALL odd pages right through the appendices. > > Can anyone help? > > Ron > > <?xml version="1.0" encoding="UTF-8" ?> > <!DOCTYPE article> > <article xml:id="LL" xmlns="http://docbook.org/ns/docbook" > version="5.0" xml:lang="EN"> > <info><title>Title of article</title></info> > > <section xml:id="LL_first" xmlns="http://docbook.org/ns/docbook" > version="5.0" xml:lang="EN"> > <info><title>Title of first section</title></info> > <literallayout> > 1 > 2 etc. > </literallayout> > <literallayout> > 1 > 2 etc. > </literallayout> > <literallayout> > 1 > 2 etc. > </literallayout> > </section> > > <section xml:id="LL_second" xmlns="http://docbook.org/ns/docbook" > version="5.0" xml:lang="EN"> > <info><title>Title of second section</title></info> > <literallayout> > 1 > 2 etc. > </literallayout> > <literallayout> > 1 > 2 etc. > </literallayout> > <literallayout>etc</literallayout> > </section> > > <appendix xml:id="LL_App_A" xmlns="http://docbook.org/ns/docbook" > version="5.0" xml:lang="EN"> > <info><title>Title of Appendix A</title></info> > <literallayout> > 1 > 2 etc. > </literallayout> > <literallayout> > 1 > 2 etc. > </literallayout> > <literallayout>etc</literallayout> > </appendix> > > <appendix xml:id="LL_App_B" xmlns="http://docbook.org/ns/docbook" > version="5.0" xml:lang="EN"> > <info><title>Title of Appendix B</title></info> > <literallayout> > 1 > 2 etc. > </literallayout> > <literallayout> > 1 > 2 etc. > </literallayout> > <literallayout>etc</literallayout> > </appendix> > </article> > > > with the customization layer: > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet > xmlns="http://www.w3.org/1999/xhtml" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:exsl="http://exslt.org/common" > xmlns:d="http://docbook.org/ns/docbook" > xmlns:fo="http://www.w3.org/1999/XSL/Format" > version="1.0" > exclude-result-prefixes="exsl"> > <xsl:import > href="/Applications/Utilities/oxygen/8.2/oxygen/frameworks/docbook/5.0/docbook-xsl-ns-1.73.2/fo/docbook.xsl"/> > > <xsl:param name="double.sided" select="1" /> > <xsl:param name="line-height" select="5" /> > <xsl:param name="header.column.widths" select="'1 10 1'" /> > <xsl:param name="header.rule" select="1" /> > <xsl:template name="head.sep.rule"> > <xsl:if test="$header.rule != 0"> > <xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute> > <xsl:attribute name="border-bottom-style">solid</xsl:attribute> > <xsl:attribute name="border-bottom-color">black</xsl:attribute> > </xsl:if> > </xsl:template> > > <xsl:template name="header.content"> > <xsl:param name="pageclass" select="''"/> > <xsl:param name="sequence" select="''"/> > <xsl:param name="position" select="''"/> > <xsl:param name="gentext-key" select="''"/> > <xsl:variable name="candidate"> > <xsl:choose> > <xsl:when test="$double.sided != 0 and $sequence = 'odd' and > $position = 'center'"> > <fo:retrieve-marker > retrieve-class-name="section.head.marker" > retrieve-position="first-including-carryover" > retrieve-boundary="page-sequence"/> > <xsl:apply-templates select="." mode="title.markup"/> > </xsl:when> > <!-- <xsl:value-of > select="ancestor-or-self::d:article/d:section/d:info/d:title"/> --> > <xsl:when test="$double.sided != 0 and $sequence = 'even' and > $position = 'center'"> > <xsl:value-of > select="ancestor-or-self::d:article/d:info/d:title"/> > </xsl:when> > </xsl:choose> > </xsl:variable> > <xsl:choose> > <xsl:when test="$sequence='blank' and $headers.on.blank.pages=0"> > </xsl:when> > <xsl:when test="$pageclass = 'titlepage'"> > </xsl:when> > <xsl:otherwise> > <xsl:copy-of select="$candidate"/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> > </xsl:stylesheet> > > > -- > Ron Catterall, Phd, DSc email: > ron@catterall.net > Prolongacion de Hidalgo 140 http://catterall.net/ > San Felipe del Agua tel: +52 951 520 1821 > Oaxaca 68020 Mexico fax: +1 530 348 8309 -------------------------------------------------------------------------------- > --------------------------------------------------------------------- > 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]