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]
Other format: [Raw text]

RE: Image/media alignment


I think this is an xsl bug. Using xep, the image is aligned if you put it in a <figure>, but not if it's a bare <mediaobject>. You can log the bug here: http://sourceforge.net/tracker/index.php?group_id=21935&atid=373747 

In the mean time, add the following to you customization layer.

David

<xsl:template match="imagedata">
  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
  <xsl:variable name="filename">
    <xsl:call-template name="mediaobject.filename">
      <xsl:with-param name="object" select=".."/>
    </xsl:call-template>
  </xsl:variable>

  <xsl:choose>
    <xsl:when test="@format='linespecific'">
      <xsl:choose>
        <xsl:when test="$use.extensions != '0'
                        and $textinsert.extension != '0'">
          <xsl:choose>
            <xsl:when test="contains($vendor, 'SAXON')">
              <stext:insertfile href="{$filename}"/>
            </xsl:when>
            <xsl:when test="contains($vendor, 'Apache Software Foundation')">
              <xtext:insertfile href="{$filename}"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:message terminate="yes">
                <xsl:text>Don't know how to insert files with </xsl:text>
                <xsl:value-of select="$vendor"/>
              </xsl:message>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <xsl:otherwise>
          <a xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
             href="{$filename}"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
		<fo:block>
		  <xsl:if test="@align">
			<xsl:attribute name="text-align"><xsl:value-of select="@align"/></xsl:attribute>
		  </xsl:if>
		  <xsl:call-template name="process.image"/>
		</fo:block>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>



-----Original Message-----
From: Marc Palmer [mailto:marc@anyware.co.uk]
Sent: Sunday, December 15, 2002 6:22 PM
To: docbook-apps@lists.oasis-open.org
Subject: DOCBOOK-APPS: Image/media alignment


Hi,

I have not been able to get the FO output of the DocBook XSL stylesheets 
to produce aligned images.

How is one supposed to do this? The align attribute on mediaobject works 
fine for HTML output, but for FO it outputs the text-align attribute and 
this has no effect on the image position (when rendered with FOP). I 
tried manually editing the FO output to use display-align and then 
rebuilt with FOP and still no luck.

Does anyone know if this is a problem with the XSL stylesheets for FO 
output, or a problem with FOP, or a combination of both?

It's causing me a lot of problems - documents with all images on the left 
are not very appealing!

Best wishes,
Marc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ W<A> ~~~~~
(o) Wangjammer5 (Marc Palmer) 
( ) Wangjammer7 

www.wangjammers.org = Java Consultants (Web|Smartcards|Crypto)


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