summaryrefslogtreecommitdiff
path: root/xhtml-1_1/graphics.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'xhtml-1_1/graphics.xsl')
-rw-r--r--xhtml-1_1/graphics.xsl60
1 files changed, 48 insertions, 12 deletions
diff --git a/xhtml-1_1/graphics.xsl b/xhtml-1_1/graphics.xsl
index e8f0bf9..458809f 100644
--- a/xhtml-1_1/graphics.xsl
+++ b/xhtml-1_1/graphics.xsl
@@ -1,10 +1,7 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--This file was created automatically by html2xhtml-->
-<!--from the HTML stylesheets.-->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:stext="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.TextFactory" xmlns:simg="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.ImageIntrinsics" xmlns:ximg="xalan://com.nwalsh.xalan.ImageIntrinsics" xmlns:xtext="xalan://com.nwalsh.xalan.Text" xmlns:lxslt="http://xml.apache.org/xslt" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xlink stext xtext lxslt simg ximg" extension-element-prefixes="stext xtext" version="1.0">
+<?xml version="1.0" encoding="ASCII"?><!--This file was created automatically by html2xhtml--><!--from the HTML stylesheets.--><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:stext="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.TextFactory" xmlns:simg="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.ImageIntrinsics" xmlns:ximg="xalan://com.nwalsh.xalan.ImageIntrinsics" xmlns:xtext="xalan://com.nwalsh.xalan.Text" xmlns:lxslt="http://xml.apache.org/xslt" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xlink stext xtext lxslt simg ximg" extension-element-prefixes="stext xtext" 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.
@@ -39,10 +36,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>
@@ -339,7 +343,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>
@@ -406,7 +410,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>
@@ -595,7 +599,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>
@@ -979,8 +986,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">
@@ -1185,7 +1196,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">
@@ -1324,6 +1342,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>
@@ -1332,7 +1354,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>
@@ -1347,7 +1376,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>
@@ -1471,4 +1507,4 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
</xsl:choose>
</xsl:template>
-</xsl:stylesheet>
+</xsl:stylesheet> \ No newline at end of file