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]

Fix for problem with <step>s 2 ff. in <procedure>?


Hi there,

Given the following xml,

<procedure>
  <title>Scary Procedure</title>
  <step>
	<para>
	  I'm on the first step, Johnny.
	</para>
  </step>
  <step>
	<para>
	  I'm on the second step, Johnny.
	</para>
  </step>
  <step>
	<para>
	  I'm on the third step, Johnny.
	</para>
  </step>
  <step>
	<para>
	  I'm on the fourth step, Johnny.
	</para>
  </step>
</procedure>

I was getting output that looked like this in my pdfs (see the bad fo at
the bottom of this message):

Scary Procedure

1 I'm on the first step, Johnny.
2
  I'm on the second step, Johnny.
3
  I'm on the third step, Johnny.
4
  I'm on the fourth step, Johnny.


I fixed it by overriding the template fo/lists.xsl (v. 1.41, Lines
413ff., though I had noticed the problem in previous versions) as
follows:

<xsl:template match="step">
  <xsl:variable name="id"><xsl:call-template
name="object.id"/></xsl:variable>
  <fo:list-item>
    <fo:list-item-label end-indent="label-end()">
<!--
Adding the following attributes to the next fo:block element to fix step
bug:
            space-before.optimum="1em"
            space-before.minimum="0.8em"
            space-before.maximum="1.2em"
-->
      <fo:block id="{$id}"
            space-before.optimum="1em"
            space-before.minimum="0.8em"
            space-before.maximum="1.2em">
        <xsl:apply-templates select="." mode="number">
          <xsl:with-param name="recursive" select="0"/>
        </xsl:apply-templates>
      </fo:block>
    </fo:list-item-label>
    <fo:list-item-body start-indent="body-start()">
      <xsl:apply-templates/>
    </fo:list-item-body>
  </fo:list-item>
</xsl:template>

I noticed that these attributes were in the fo:block element for the
list item, but not for the list number. My question is did I do the
right thing, or is there something I don't understand that will cause me
to regret the change later? My understanding of fo, not to mention xsl,
is limited.

Thanks,
David



Fo that was causing the badness in the pdf:

<fo:block font-weight="bold">Scary Procedure</fo:block><fo:list-block
space-before.optimum="1em" space-before.minimum="0.8em"
space-before.maximum="1.2em" provisional-label-separation="0.2em"
provisional-distance-between-starts="2em"><fo:list-item><fo:list-item-la
bel end-indent="label-end()"><fo:block
id="NB">1</fo:block></fo:list-item-label><fo:list-item-body
start-indent="body-start()"><fo:block space-before.optimum="1em"
space-before.minimum="0.8em" space-before.maximum="1.2em">
		I'm on the first step, Johnny.
	
</fo:block></fo:list-item-body></fo:list-item><fo:list-item><fo:list-ite
m-label end-indent="label-end()"><fo:block
id="NF">2</fo:block></fo:list-item-label><fo:list-item-body
start-indent="body-start()"><fo:block space-before.optimum="1em"
space-before.minimum="0.8em" space-before.maximum="1.2em">
		I'm on the second step, Johnny.
	
</fo:block></fo:list-item-body></fo:list-item><fo:list-item><fo:list-ite
m-label end-indent="label-end()"><fo:block
id="N13">3</fo:block></fo:list-item-label><fo:list-item-body
start-indent="body-start()"><fo:block space-before.optimum="1em"
space-before.minimum="0.8em" space-before.maximum="1.2em">
		I'm on the third step, Johnny.
	
</fo:block></fo:list-item-body></fo:list-item><fo:list-item><fo:list-ite
m-label end-indent="label-end()"><fo:block
id="N17">4</fo:block></fo:list-item-label><fo:list-item-body
start-indent="body-start()"><fo:block space-before.optimum="1em"
space-before.minimum="0.8em" space-before.maximum="1.2em">
		I'm on the fourth step, Johnny.
	
</fo:block></fo:list-item-body></fo:list-item></fo:list-block></fo:block
></fo:block>


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