<!-- Get align value from internal mediaobject -->
<xsl:variable name="align">
- <xsl:if test="mediaobject">
+ <xsl:if test="mediaobject|mediaobjectco">
<xsl:variable name="olist" select="mediaobject/imageobject
- |mediaobject/imageobjectco
+ |mediaobjectco/imageobjectco
|mediaobject/videoobject
|mediaobject/audioobject
|mediaobject/textobject"/>
<xsl:variable name="object" select="$olist[position() = $object.index]"/>
- <xsl:value-of select="$object/imagedata[@align][1]/@align"/>
+ <xsl:value-of select="$object/descendant::imagedata[@align][1]/@align"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="object" select="$olist[position() = $object.index]"/>
<xsl:variable name="align">
- <xsl:value-of select="$object/imagedata[@align][1]/@align"/>
+ <xsl:value-of select="$object/descendant::imagedata[@align][1]/@align"/>
</xsl:variable>
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
- <fo:block id="{$id}">
+ <fo:block id="{$id}"
+ text-align="{$alignment}">
+ <!-- The above restores alignment altered by image align attribute -->
<xsl:if test="title">
<xsl:apply-templates select="title" mode="list.title.mode"/>
</xsl:if>