Skip to content
Snippets Groups Projects
Commit ae2833b1 authored by Goik Martin's avatar Goik Martin
Browse files

Handling <imagedata> @valign

parent 97fa4249
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:simg="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.ImageIntrinsics"
xmlns:ximg="xalan://com.nwalsh.xalan.ImageIntrinsics"
xmlns:d="http://docbook.org/ns/docbook">
<xsl:import href="../../docbook-xsl/xhtml/chunk.xsl"/>
......@@ -111,6 +113,31 @@
</xsl:template>
<!-- Hack: Docbook XSL does not handle @valign in images-->
<xsl:template match="d:mediaobject[d:imageobject/d:imagedata[@valign]]">
<img src="{d:imageobject/d:imagedata/@fileref}">
<xsl:attribute name="style">
<xsl:variable name="dbValign" select="d:imageobject/d:imagedata/@valign"/>
<xsl:text>vertical-align: </xsl:text>
<xsl:choose>
<xsl:when test="$dbValign = 'top'">text-top</xsl:when>
<xsl:when test="$dbValign = 'middle'">middle</xsl:when>
<xsl:when test="$dbValign = 'bottom'">text-bottom</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Unknown @valign value: </xsl:text>
<xsl:value-of select="$dbValign"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</img>
</xsl:template>
<!-- <xsl:template match="d:section">
<xsl:param name="titleset"/>
<xsl:variable name="extendedTitleset" select="$titleset|d:title"/>
......@@ -155,4 +182,8 @@
</h4>
</xsl:template>
-->
</xsl:stylesheet>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment