From: <bob...@us...> - 2011-10-03 15:51:59
|
Revision: 9108 http://docbook.svn.sourceforge.net/docbook/?rev=9108&view=rev Author: bobstayton Date: 2011-10-03 15:51:48 +0000 (Mon, 03 Oct 2011) Log Message: ----------- Allow selection by role for multiple imageobject elements within an imageobjectco, which since Docbook 5 allows multiple imageobjects. Modified Paths: -------------- trunk/xsl/fo/graphics.xsl trunk/xsl/html/graphics.xsl Modified: trunk/xsl/fo/graphics.xsl =================================================================== --- trunk/xsl/fo/graphics.xsl 2011-10-03 06:13:14 UTC (rev 9107) +++ trunk/xsl/fo/graphics.xsl 2011-10-03 15:51:48 UTC (rev 9108) @@ -434,8 +434,32 @@ <!-- ==================================================================== --> <xsl:template match="imageobjectco"> - <xsl:apply-templates select="imageobject"/> + <xsl:choose> + <!-- select one imageobject? --> + <xsl:when test="$use.role.for.mediaobject != 0 and + count(imageobject) > 1 and + imageobject[@role]"> + <xsl:variable name="olist" select="imageobject"/> + + <xsl:variable name="object.index"> + <xsl:call-template name="select.mediaobject.index"> + <xsl:with-param name="olist" select="$olist"/> + <xsl:with-param name="count" select="1"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="object" select="$olist[position() = $object.index]"/> + + <xsl:apply-templates select="$object"/> + </xsl:when> + <xsl:otherwise> + <!-- otherwise process them all --> + <xsl:apply-templates select="imageobject"/> + </xsl:otherwise> + </xsl:choose> + <xsl:apply-templates select="calloutlist"/> + </xsl:template> <xsl:template match="imageobject"> Modified: trunk/xsl/html/graphics.xsl =================================================================== --- trunk/xsl/html/graphics.xsl 2011-10-03 06:13:14 UTC (rev 9107) +++ trunk/xsl/html/graphics.xsl 2011-10-03 15:51:48 UTC (rev 9108) @@ -1159,8 +1159,32 @@ <xsl:template match="imageobjectco"> <xsl:call-template name="anchor"/> - <xsl:apply-templates select="imageobject"/> + <xsl:choose> + <!-- select one imageobject? --> + <xsl:when test="$use.role.for.mediaobject != 0 and + count(imageobject) > 1 and + imageobject[@role]"> + <xsl:variable name="olist" select="imageobject"/> + + <xsl:variable name="object.index"> + <xsl:call-template name="select.mediaobject.index"> + <xsl:with-param name="olist" select="$olist"/> + <xsl:with-param name="count" select="1"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="object" select="$olist[position() = $object.index]"/> + + <xsl:apply-templates select="$object"/> + </xsl:when> + <xsl:otherwise> + <!-- otherwise process them all --> + <xsl:apply-templates select="imageobject"/> + </xsl:otherwise> + </xsl:choose> + <xsl:apply-templates select="calloutlist"/> + </xsl:template> <xsl:template match="imageobject"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |