[xep-support] Possible Bug in XEP w/ nested <fo:block/>'s

From: Johann Richard (Johann.richard@dspfactory.ch)
Date: Thu Jan 16 2003 - 00:00:56 PST

  • Next message: Jeff Beal: "[xep-support] Page breaks in a cell spanning multiple rows"

    Hello,

    There is a possible bug in XEP (3.17) when nesting <fo:block/>'s.

    The following should, as of my understanding, render the same way in PDF Output:

    <fo:block id="c1" space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em">
            [ content ]
    </fo:block>
    <fo:block id="c2" space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em">
      <fo:block space-before="0pt" space-after="0pt" background-color="#E0E0E0">
            [ content ]
      </fo:block>
    </fo:block>

    and

    <fo:block id="c1" space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em">
            [ content ]
    </fo:block>
    <fo:block id="c2" space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" background-color="#E0E0E0">
            [ content ]
    </fo:block>

    however, in the resulting output, the former produces a bigger margin between the "c1" and "c2" block than the second one.

    You can check this behaviour w/ DocBook and the following customization to output the FO without nested blocks for shaded programlistings:

    *** snip -- fo customization ***

    <xsl:template match="programlisting|screen|synopsis">
      <xsl:param name="suppress-numbers" select="'0'"/>
      <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>

      <xsl:variable name="content">
        <xsl:choose>
          <xsl:when test="$suppress-numbers = '0'
                          and @linenumbering = 'numbered'
                          and $use.extensions != '0'
                          and $linenumbering.extension != '0'">
            <xsl:call-template name="number.rtf.lines">
              <xsl:with-param name="rtf">
                <xsl:apply-templates/>
              </xsl:with-param>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>

        <xsl:choose>
          <xsl:when test="$shade.verbatim != 0">
                              <fo:block wrap-option='no-wrap'
                                        white-space-collapse='false'
                                        linefeed-treatment="preserve"
                                        xsl:use-attribute-sets="monospace.verbatim.properties shade.verbatim.style">
              <xsl:copy-of select="$content"/>
            </fo:block>
          </xsl:when>
          <xsl:otherwise>
                              <fo:block wrap-option='no-wrap'
                                        white-space-collapse='false'
                                        linefeed-treatment="preserve"
                                        xsl:use-attribute-sets="monospace.verbatim.properties">
                    <xsl:copy-of select="$content"/>
                              </fo:block>
          </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    *** snip ***

    and with this code:

    <para>[content]</para>
    <programlisting>[content]</programlisting>

    and

    <xsl:param name="shade.verbatim" select="1"/>

    DocBook will -- by default -- add a nested fo:block in the one w/ the programlisting to set the background property. My customization combines these two in one fo:block.

    As space-before and space-after do not seem to be inheritable properties---nor margins or paddings (AFAIK)---I do not think that the parent fo:block of the mentioned piece of code really matters for that cause. Correct me if I am wrong.

    Best regards,
    Johann Richard
    ********************************************
    Johann Richard
    IC & DSP Design Engineer
    Dspfactory SA
    Champs-Montants 12a
    2074 Marin-Epagnier
    Switzerland

    Tel: +41 32 755 7400
    Fax: +41 32 755 7401
    e-mail: mailto:johann.richard@dspfactory.ch

    http://www.dspfactory.com
    ********************************************
    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



    This archive was generated by hypermail 2.1.5 : Wed Jan 15 2003 - 23:57:39 PST