This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Identify first <section>?


>
>Change side="recto" to t:side="recto" and it should work.
>
>Note that you will get page breaks for the first section at
>level 2, 3, etc. as well. Is that what you intended?  Your test
>needs to test for parent being chapter (or appendix if you
>use those).
>
>Bob Stayton
>Sagehill Enterprises
>bobs@sagehill.net

Ah. That's the little fella!

>>Note that you will get page breaks for the first section at level 2, 3, 
etc. as well
Indeed. I had that in mind... little steps ;o)

For clarity - and other's possible use, here's the code in full:

../fo/titlepage.templates.xml
-----------------------------
<t:titlepage t:element="section" t:wrapper="fo:block">
...
...
  <t:titlepage-before t:side="recto">
    <xsl:param name="node" select="."/>
    <xsl:if test="not($node/preceding-sibling::section)">
      <xsl:if 
test="$node/parent::chapter|$node/parent::appendix|$node/parent::preface">
        <fo:block break-before="page"/>
      </xsl:if>
    </xsl:if>
  </t:titlepage-before>
...
...
</t:titlepage>

my.fo.customisation.layer.xsl
-----------------------------

<!-- Double sided print & odd page chapter start                  -->
<xsl:param name="double.sided">1</xsl:param>

<!--Force Section1 ("topics") - onto new page                     -->
<!--Makes all my level 1 <section>s start on a new page and, with
    the t:element="section" patch above, forces the first topic
    in a chapter to start on an odd page                          -->
  <xsl:attribute-set name="section.level1.properties">
  <xsl:attribute name="break-before">page</xsl:attribute>
</xsl:attribute-set>

This works for me using v1.6.2.4 Docbook Stylesheets and FOP 0.20.5

Thanks for the help, Bob.

Mart





"Bob Stayton" <bobs@sagehill.net>
10/12/2003 19:14
 
        To:     <docbook-apps@lists.oasis-open.org>, 
<martin.gautier@myrnham.co.uk>
        cc: 
        Subject:        Re: [docbook-apps] Identify first <section>?


Change side="recto" to t:side="recto" and it should work.

Note that you will get page breaks for the first section at
level 2, 3, etc. as well. Is that what you intended?  Your test
needs to test for parent being chapter (or appendix if you
use those).

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: <martin.gautier@myrnham.co.uk>
To: <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, December 10, 2003 10:40 AM
Subject: Re: [docbook-apps] Identify first <section>?


> >>
> >> <t:titlepage t:element="section" t:wrapper="fo:block">
> >> ...
> >>   <t:titlepage-before side="recto">
> >>     <xsl:param name="node" select="."/>
> >>     <xsl:if test="not(node/preceding-sibling::section)">
> >>       <fo:block break-before="page"/>
> >>       <fo:block font-size="14pt" font-family="verdana"
> >> font-color="red">DEBUG:</fo:block>
> >>     </xsl:if>
> >>   </t:titlepage-before>
> >>
> >> The <xsl:if test="not(node/preceding-sibling::section)"> doesn't seem
> to
> >> pick up what I'm after. Any suggestions?
> >
> >It looks like you are missing a "$" in front of "node" in
> >the test expression.  So it is looking for an element
> >named node instead of a parameter of that name.
>
> Bob
>
> My source now has the "$". It did originally but must have disappeared
> during one of my many jiggles to get it to work...
>
> Unfortunately I'm still not getting anywhere.
>
> test="not($node/preceding-sibling::section)" does actually check all
> sibling elements before node right? ie. in:
>
> <chapter>
>    <title>
>    <chapterinfo>..</>
>    <section>                <-- if here
>    <section>
>
> ..will check <title> and <chapterinfo> to return "true"?
>
> >:0(
>
> Mart
>
>
> To unsubscribe from this list, send a post to
docbook-apps-unsubscribe@lists.oasis-open.org, or visit
http://www.oasis-open.org/mlmanage/.
>
>


To unsubscribe from this list, send a post to 
docbook-apps-unsubscribe@lists.oasis-open.org, or visit 
http://www.oasis-open.org/mlmanage/.




To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]