xsl-list
[Top] [All Lists]

[xsl] adjust width of block to previous block

2011-07-15 10:07:12
Dear all,

I am using Apache FOP version 0.95. Furthermore I am using xsl-fo to
generate pdf out of Matlab (matlab generates an xml-file and I use a
xsl-fo file as style sheet)

I don't know how to adjust the width of a next block to the previous
block. I have an external graphic in a block and want the next block
to have the same size as the block containing the external graphic.


<fo:block space-after="3mm"> <!-- block with external graphic which
width is dynamic -->
   <fo:external-graphic>
    <xsl:attribute name="src">url('<xsl:value-of
select="@filename"/>')</xsl:attribute>
    <xsl:attribute name="content-height">
     <xsl:choose>
      <xsl:when test="@height">
       <xsl:value-of select="@height" />
      </xsl:when>
      <xsl:otherwise>100%</xsl:otherwise>
     </xsl:choose>
    </xsl:attribute>
    <xsl:attribute name="content-width">
     <xsl:choose>
      <xsl:when test="@width">
       <xsl:value-of select="@width" />
      </xsl:when>
      <xsl:otherwise>100%</xsl:otherwise>
     </xsl:choose>
    </xsl:attribute>
   </fo:external-graphic>
  </fo:block>
  <fo:block font-size="8pt" text-align="justify" wrap-option="wrap" >
<!-- width of this block must be equal to the previous block in order
to have the text (@caption) in line with the graphic
   <xsl:value-of select="@caption" />
  </fo:block>

Thanks for your help,
Mathis

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>