</xsl:choose>
</xsl:variable>
- <!-- FIXME: is this too careless? -->
- <xsl:choose>
- <xsl:when test=".//imagedata[@align][1]">
- <fo:block text-align="{.//imagedata[@align][1]/@align}">
+ <xsl:variable name="figure">
+ <!-- FIXME: is this too careless? -->
+ <xsl:choose>
+ <xsl:when test=".//imagedata[@align][1]">
+ <fo:block text-align="{.//imagedata[@align][1]/@align}">
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
+ </fo:block>
+ </xsl:when>
+ <xsl:otherwise>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
- </fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="@float and @float != 0">
+ <fo:float>
+ <xsl:attribute name="float">
+ <xsl:choose>
+ <xsl:when test="@float = 1">
+ <xsl:value-of select="$default.float.class"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@float"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:copy-of select="$figure"/>
+ </fo:float>
</xsl:when>
<xsl:otherwise>
- <xsl:call-template name="formal.object">
- <xsl:with-param name="placement" select="$placement"/>
- </xsl:call-template>
+ <xsl:copy-of select="$figure"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:choose>
</xsl:template>
-<xsl:template match="figure|table|example">
+<xsl:template match="figure">
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="@float and @float != 0">
+ <xsl:variable name="float">
+ <xsl:choose>
+ <xsl:when test="@float = 1">
+ <xsl:value-of select="$default.float.class"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@float"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <div class="figure-float">
+ <xsl:if test="$float = 'left' or $float = 'right'">
+ <xsl:attribute name="style">
+ <xsl:text>float: </xsl:text>
+ <xsl:value-of select="$float"/>
+ <xsl:text>;</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
+ </div>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="table|example">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
--- /dev/null
+<refentry id="default.float.class">
+<refmeta>
+<refentrytitle>default.float.class</refentrytitle>
+<refmiscinfo role="type">string</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>default.float.class</refname>
+<refpurpose>Specifies the default float class</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='default.float.class.frag'>
+<xsl:param name="default.float.class" select="'before'"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>FIXME:</para>
+
+</refsect1>
+</refentry>