summaryrefslogtreecommitdiff
path: root/html/graphics.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'html/graphics.xsl')
-rw-r--r--html/graphics.xsl53
1 files changed, 46 insertions, 7 deletions
diff --git a/html/graphics.xsl b/html/graphics.xsl
index da5bf9a..ce0e6ed 100644
--- a/html/graphics.xsl
+++ b/html/graphics.xsl
@@ -11,7 +11,7 @@
version='1.0'>
<!-- ********************************************************************
- $Id: graphics.xsl 9367 2012-05-12 23:46:35Z bobstayton $
+ $Id: graphics.xsl 9710 2013-01-22 19:34:18Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
@@ -77,10 +77,17 @@
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</div>
</xsl:template>
+<xsl:template match="screenshot/title">
+ <xsl:call-template name="formal.object.heading">
+ <xsl:with-param name="object" select=".."/>
+ </xsl:call-template>
+</xsl:template>
+
<xsl:template match="screeninfo">
</xsl:template>
@@ -388,7 +395,7 @@
<xsl:with-param name="em.size" select="$points.per.em"/>
</xsl:call-template>
</xsl:variable>
- <xsl:value-of select="$cwidth.in.points div 72.0 * $pixels.per.inch * $scale"/>
+ <xsl:value-of select="round($cwidth.in.points div 72.0 * $pixels.per.inch * $scale)"/>
</xsl:if>
</xsl:variable>
@@ -455,7 +462,7 @@
<xsl:with-param name="em.size" select="$points.per.em"/>
</xsl:call-template>
</xsl:variable>
- <xsl:value-of select="$cdepth.in.points div 72.0 * $pixels.per.inch * $scale"/>
+ <xsl:value-of select="round($cdepth.in.points div 72.0 * $pixels.per.inch * $scale)"/>
</xsl:if>
</xsl:variable>
@@ -657,7 +664,10 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
<xsl:copy-of select="$alt"/>
</xsl:when>
<xsl:when test="ancestor::figure">
- <xsl:value-of select="normalize-space(ancestor::figure/title)"/>
+ <xsl:variable name="fig.title">
+ <xsl:apply-templates select="ancestor::figure/title/node()"/>
+ </xsl:variable>
+ <xsl:value-of select="normalize-space($fig.title)"/>
</xsl:when>
</xsl:choose>
</xsl:with-param>
@@ -1055,8 +1065,12 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
</xsl:choose>
</xsl:attribute>
</xsl:if>
+
+ <xsl:call-template name="extension.process.image.attributes"/>
</xsl:template>
+<xsl:template name="extension.process.image.attributes"/>
+
<!-- ==================================================================== -->
<xsl:template match="graphic">
@@ -1273,7 +1287,14 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
<xsl:call-template name="process.image">
<xsl:with-param name="alt">
- <xsl:apply-templates select="$phrases[not(@role) or @role!='tex'][1]"/>
+ <xsl:choose>
+ <xsl:when test="ancestor::mediaobject/alt">
+ <xsl:apply-templates select="ancestor::mediaobject/alt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$phrases[not(@role) or @role!='tex'][1]"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:with-param>
<xsl:with-param name="longdesc">
<xsl:call-template name="write.longdesc">
@@ -1416,6 +1437,10 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
<!-- ==================================================================== -->
+<xsl:template match="mediaobject/alt">
+ <xsl:apply-templates/>
+</xsl:template>
+
<xsl:template match="videoobject">
<xsl:apply-templates select="videodata"/>
</xsl:template>
@@ -1424,7 +1449,14 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
<xsl:call-template name="process.image">
<xsl:with-param name="tag" select="'embed'"/>
<xsl:with-param name="alt">
- <xsl:apply-templates select="(../../textobject/phrase)[1]"/>
+ <xsl:choose>
+ <xsl:when test="ancestor::mediaobject/alt">
+ <xsl:apply-templates select="ancestor::mediaobject/alt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="(ancestor::mediaobject/textobject/phrase)[1]"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
@@ -1439,7 +1471,14 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
<xsl:call-template name="process.image">
<xsl:with-param name="tag" select="'embed'"/>
<xsl:with-param name="alt">
- <xsl:apply-templates select="(../../textobject/phrase)[1]"/>
+ <xsl:choose>
+ <xsl:when test="ancestor::mediaobject/alt">
+ <xsl:apply-templates select="ancestor::mediaobject/alt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="(ancestor::mediaobject/textobject/phrase)[1]"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:template>