From ad2cc7b18b338f9cf57e0592e86c8c5e917a0d1e Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Sat, 9 Jul 2022 20:16:23 +0200 Subject: [PATCH] Handling captions in mediaobjects --- .../CustomLayer/Klausur/docbook2klausur.xsl | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/ws/Docbook/CustomLayer/Klausur/docbook2klausur.xsl b/ws/Docbook/CustomLayer/Klausur/docbook2klausur.xsl index 5c6ce6fba..7bb087235 100644 --- a/ws/Docbook/CustomLayer/Klausur/docbook2klausur.xsl +++ b/ws/Docbook/CustomLayer/Klausur/docbook2klausur.xsl @@ -131,10 +131,18 @@ --> </span> </xsl:template> + + - <xsl:template match="db:informaltable"> - <table border="{@border}" style="border-collapse: collapse;"> + <xsl:template match="db:informaltable|db:table"> + + <table border="{@border}" style="border-collapse: collapse;margin-left: auto; margin-right: auto;"> + <xsl:for-each select="db:caption"> + <caption style="font-style:italic;"> + <xsl:apply-templates/> + </caption> + </xsl:for-each> <xsl:for-each select="db:tr"> <tr> <xsl:apply-templates/> @@ -154,7 +162,7 @@ </xsl:template> <xsl:template match="db:th"> - <td style="text-align: center; font-weight: bolder;" valign="top"> + <td style="text-align: center; font-weight: bold;" valign="top"> <xsl:copy-of select="@colspan"/> <xsl:copy-of select="@rowspan"/> <xsl:apply-templates/> @@ -251,8 +259,8 @@ <xsl:with-param name="svgFilename" select="db:imageobject/db:imagedata/@fileref"/> </xsl:call-template> </xsl:variable> - - <img> + <figure style="text-align: center;"> + <img> <xsl:attribute name="src"> <xsl:text>data:image/</xsl:text> <xsl:variable name="filename" select="db:imageobject/db:imagedata/@fileref"/> @@ -271,7 +279,13 @@ <xsl:text>;base64,</xsl:text> <xsl:value-of select="document($base64Filename)/data/text()"/> </xsl:attribute> - </img> + </img> + <xsl:for-each select="db:caption"> + <figcaption style="font-style:italic;"> + <xsl:apply-templates/> + </figcaption> + </xsl:for-each> + </figure> </xsl:template> <!-- link mode --> -- GitLab