Menu

#20 Fix for <step>s 2 ff. in <procedure>

closed-fixed
nobody
XSL (122)
5
2001-09-23
2001-09-10
No

I checked and this problem still exists in 1.44 of the
xsl stylesheets.

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>

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>

Discussion

  • Norman Walsh

    Norman Walsh - 2001-09-23

    Logged In: YES
    user_id=81663

    Thank you, fixed in CVS.

     
  • Norman Walsh

    Norman Walsh - 2001-09-23
    • status: open --> closed-fixed
     

Log in to post a comment.