From: <bob...@us...> - 2007-09-14 22:14:57
|
Revision: 7447 http://docbook.svn.sourceforge.net/docbook/?rev=7447&view=rev Author: bobstayton Date: 2007-09-14 15:14:55 -0700 (Fri, 14 Sep 2007) Log Message: ----------- Complete support for <?dbfo pgwide="1"?> for informal elements too. Modified Paths: -------------- trunk/xsl/fo/formal.xsl Modified: trunk/xsl/fo/formal.xsl =================================================================== --- trunk/xsl/fo/formal.xsl 2007-09-14 02:16:48 UTC (rev 7446) +++ trunk/xsl/fo/formal.xsl 2007-09-14 22:14:55 UTC (rev 7447) @@ -130,18 +130,50 @@ <xsl:call-template name="pi.dbfo_keep-together"/> </xsl:variable> + <!-- These don't have a pgwide attribute, so may use a PI --> + <xsl:variable name="pgwide.pi"> + <xsl:call-template name="pi.dbfo_pgwide"/> + </xsl:variable> + + <xsl:variable name="pgwide"> + <xsl:choose> + <xsl:when test="$pgwide.pi"> + <xsl:value-of select="$pgwide.pi"/> + </xsl:when> + <!-- child element may set pgwide --> + <xsl:when test="*[@pgwide]"> + <xsl:value-of select="*[@pgwide][1]/@pgwide"/> + </xsl:when> + </xsl:choose> + </xsl:variable> + <xsl:choose> <!-- informaltables have their own templates and are not handled by formal.object --> <xsl:when test="local-name(.) = 'equation'"> - <fo:block id="{$id}" - xsl:use-attribute-sets="equation.properties"> - <xsl:if test="$keep.together != ''"> - <xsl:attribute name="keep-together.within-column"><xsl:value-of - select="$keep.together"/></xsl:attribute> - </xsl:if> - <xsl:apply-templates/> - </fo:block> + <xsl:choose> + <xsl:when test="$pgwide = '1'"> + <fo:block id="{$id}" + xsl:use-attribute-sets="pgwide.properties + equation.properties"> + <xsl:if test="$keep.together != ''"> + <xsl:attribute name="keep-together.within-column"><xsl:value-of + select="$keep.together"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:block id="{$id}" + xsl:use-attribute-sets="equation.properties"> + <xsl:if test="$keep.together != ''"> + <xsl:attribute name="keep-together.within-column"><xsl:value-of + select="$keep.together"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:otherwise> + </xsl:choose> </xsl:when> <xsl:when test="local-name(.) = 'procedure'"> <fo:block id="{$id}" @@ -154,30 +186,79 @@ </fo:block> </xsl:when> <xsl:when test="local-name(.) = 'informalfigure'"> - <fo:block id="{$id}" - xsl:use-attribute-sets="informalfigure.properties"> - <xsl:if test="$keep.together != ''"> - <xsl:attribute name="keep-together.within-column"><xsl:value-of - select="$keep.together"/></xsl:attribute> - </xsl:if> - <xsl:apply-templates/> - </fo:block> + <xsl:choose> + <xsl:when test="$pgwide = '1'"> + <fo:block id="{$id}" + xsl:use-attribute-sets="pgwide.properties + informalfigure.properties"> + <xsl:if test="$keep.together != ''"> + <xsl:attribute name="keep-together.within-column"><xsl:value-of + select="$keep.together"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:block id="{$id}" + xsl:use-attribute-sets="informalfigure.properties"> + <xsl:if test="$keep.together != ''"> + <xsl:attribute name="keep-together.within-column"><xsl:value-of + select="$keep.together"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:otherwise> + </xsl:choose> </xsl:when> <xsl:when test="local-name(.) = 'informalexample'"> - <fo:block id="{$id}" - xsl:use-attribute-sets="informalexample.properties"> - <xsl:if test="$keep.together != ''"> - <xsl:attribute name="keep-together.within-column"><xsl:value-of - select="$keep.together"/></xsl:attribute> - </xsl:if> - <xsl:apply-templates/> - </fo:block> + <xsl:choose> + <xsl:when test="$pgwide = '1'"> + <fo:block id="{$id}" + xsl:use-attribute-sets="pgwide.properties + informalexample.properties"> + <xsl:if test="$keep.together != ''"> + <xsl:attribute name="keep-together.within-column"><xsl:value-of + select="$keep.together"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:block id="{$id}" + xsl:use-attribute-sets="informalexample.properties"> + <xsl:if test="$keep.together != ''"> + <xsl:attribute name="keep-together.within-column"><xsl:value-of + select="$keep.together"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:otherwise> + </xsl:choose> </xsl:when> <xsl:when test="local-name(.) = 'informalequation'"> - <fo:block id="{$id}" - xsl:use-attribute-sets="informalequation.properties"> - <xsl:apply-templates/> - </fo:block> + <xsl:choose> + <xsl:when test="$pgwide = '1'"> + <fo:block id="{$id}" + xsl:use-attribute-sets="pgwide.properties + informalequation.properties"> + <xsl:if test="$keep.together != ''"> + <xsl:attribute name="keep-together.within-column"><xsl:value-of + select="$keep.together"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:block id="{$id}" + xsl:use-attribute-sets="informalequation.properties"> + <xsl:if test="$keep.together != ''"> + <xsl:attribute name="keep-together.within-column"><xsl:value-of + select="$keep.together"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates/> + </fo:block> + </xsl:otherwise> + </xsl:choose> </xsl:when> <xsl:otherwise> <fo:block id="{$id}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |