[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Question about DocBook, FOP, inlinegraphic and vertical align
Hi,
I don't understand the relation between the attribute
vertical-align="middle" and fo:external-graphic.
In
http://www.w3.org/TR/2001/REC-xsl-20011015/slice6.html#fo_external-graphic
this attribute doesn't seem to apply but here
http://www.ecrion.com/XF/TechnicalResources/XSL-FOTutorial/Graphics.xml.html
(Figure 3) produces the desired result.
Also FOP works with this attribute and produces the "expected result".
I have modified "graphics.xsl" in the following way
<xsl:if test="@vertical-align">
<xsl:attribute name="vertical-align">
<xsl:choose>
<xsl:when test="@valign = 'top'">top</xsl:when>
<xsl:when test="@valign = 'middle'">middle</xsl:when>
<xsl:when test="@valign = 'bottom'">bottom</xsl:when>
<xsl:otherwise>auto</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
to accept that attribute.
- Does it make sense to update "graphics.xsl" ?
- Is it possible to insert this test in the docbook
"customization_layer" without modifying "graphics.xsl" ?
- Is there another (| better | standard) way to align vertically the
image respect to the inline - text ?
Thanks,
Andrea.
At 17.18 15/03/2006, you wrote:
>Dear Sir/Madam,
>I have a question about how to obtain a vertical alignment using DocBook.
>
>I have created an xml docbook "doc" like the following and I would
>like that the image, on the same line of the title,
>is aligned vertically respect to the title itself.
>
>< book >
> < bookinfo >
> < title >
> < inlinegraphic fileref ="logo.jpg " width
> ="3cm " scalefit ="1 " valign ="middle "/> TITLE </ title >
> ...
>
>I'm using XALAN and FOP to transform the "doc" and I obtain the
>following block:
>
>< fo:block font-family =" sans-serif,Symbol,ZapfDingbats "
>font-weight ="bold " font-size ="24.8832pt " text-align ="center "
>space-before ="18.6624pt ">
> < fo:block hyphenate ="false " keep-with-next.within-column
> =" always ">
> < fo:external-graphic src ="url(logo.jpg) " width
> ="3cm " height ="auto " content-width ="scale-to-fit "
> content-height ="scale-to-fit " display-align ="center "/> TITLE </ fo:block >
> </ fo:block >
>...
>
>But in this way TITLE is then rendered at the baseline of the
>graphic. I have noticed that if I specify the attribute
>vertical-align =" middle " in fo:external-graphic
>
>< fo:external-graphic src=" url(logo.jpg) " width=" 3cm " height="
>auto " content-width ="scale-to-fit " content-height ="scale-to-fit
>" display-align ="center " vertical-align ="middle "/> TITLE </ fo:block >
>
>then the result using FOP is the desired one. I also noticed that in
>file "graphics.xsl" valing sets the attribute display-align =" center ".
>
>How I can set in "doc.xml" the right tag to obtain vertical-align ="
>middle " ? Is it a problem of the DocBook stylesheet or a FOP problem ?
>
>Thank you.
>Best regards,
> Andrea.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]