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

Minor XSL corrections

parent 7012c587
No related branches found
No related tags found
No related merge requests found
......@@ -678,6 +678,7 @@
</xsl:template>
<!-- TODO: Code duplication in hdmextensions.xsl -->
<xsl:template match="d:videodata">
<video controls="controls" preload="auto" width="50%">
<xsl:attribute name="title">
......@@ -691,13 +692,27 @@
</xsl:call-template>
</xsl:variable>
<source src="{$hdm_ImageFilename}" type="video/webm"/>
<source src="{$hdm_ImageFilename}.mp4" type="video/mp4"/>
<xsl:choose>
<!-- ends-with(...) in xsl 1.0, sigh! -->
<xsl:when test="'.webm' = substring($hdm_ImageFilename, string-length($hdm_ImageFilename) - string-length('.webm') + 1)">
<source src="{$hdm_ImageFilename}" type='video/webm' />
<source src="{$hdm_ImageFilename}.mp4" type='video/mp4'/>
</xsl:when>
<xsl:when test="'.mp4' = substring($hdm_ImageFilename, string-length($hdm_ImageFilename) - string-length('.mp4') + 1)">
<source src="{$hdm_ImageFilename}" type='video/mp4'/>
</xsl:when>
<xsl:otherwise>
<source src="{$hdm_ImageFilename}" />
</xsl:otherwise>
</xsl:choose>
<xsl:text>Your Browser does not support the video tag</xsl:text>
</video>
</xsl:template>
<xsl:template match="d:programlisting">
<pre class="programlisting">
......
......@@ -50,14 +50,21 @@
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="d:videodata">
<video controls="controls" preload="auto" width="50%">
<xsl:attribute name="title">
<xsl:value-of select="normalize-space(../../../d:title)"/>
</xsl:attribute>
<xsl:choose>
<xsl:variable name="hdm_ImageFilename">
<!-- hdm_ prefix: do not mess with docbook! -->
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select=".."/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<!-- ends-with(...) in xsl 1.0, sigh! -->
<xsl:when test="'.webm' = substring($hdm_ImageFilename, string-length($hdm_ImageFilename) - string-length('.webm') + 1)">
......@@ -77,7 +84,7 @@
<xsl:text>Your Browser does not support the video tag</xsl:text>
</video>
</xsl:template>
<!-- Modifying Docbook's standard -->
<xsl:template match="d:qandaset">
......
......@@ -2,7 +2,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://docbook.org/ns/docbook"
xmlns:db="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="xs" version="2.0">
exclude-result-prefixes="xs" version="2.0">
<xsl:param name="javaApiBaseUrl"
>https://docs.oracle.com/en/java/javase/21/docs/api/java.base</xsl:param>
......@@ -155,5 +155,4 @@
<xsl:text>.html</xsl:text>
</xsl:template>
</xsl:stylesheet>
......@@ -158,8 +158,8 @@ SAXONCMD=java -cp "${DBOOK_XSL}/tools/lib/saxon9he.jar:/usr/share/java/xercesImp
fileBaseName=$$(basename $$foFile .fo); \
echo processing file $$foFile; \
sed -e 's/ ­/ /g' $$foFile > $$fileBaseName.strip.fo; \
fop -c /usr/share/hdm-docbook-xsl/CustomLayer/Fonts/config.xml -fo $$fileBaseName.strip.fo -pdf $$fileBaseName.pdf ; \
rm -f $$fileBaseName.strip.fo $$foFile; \
fop -c /usr/share/hdm-docbook-xsl/CustomLayer/Fonts/config.xml -fo $$fileBaseName.strip.fo \
-pdf $$fileBaseName.pdf || exit 0; rm -f $$fileBaseName.strip.fo $$foFile; \
done
touch $*.present
......@@ -169,7 +169,7 @@ SAXONCMD=java -cp "${DBOOK_XSL}/tools/lib/saxon9he.jar:/usr/share/java/xercesImp
# See http://stackoverflow.com/questions/39786947/how-to-convert-to-pdf-from-xsl-fo-with-mathml/39796975
%.pdf: %.print.xml
${SAXON6CMD} $< ${DBOOK_XSL_CUSTOM}/pdf/docbookHdm.xsl ${dbookXslPdfParam} > ${*}.fo
fop -c /usr/share/hdm-docbook-xsl/CustomLayer/Fonts/config.xml -fo ${*}.fo -pdf ${*}.pdf
fop -c /usr/share/hdm-docbook-xsl/CustomLayer/Fonts/config.xml -fo ${*}.fo -pdf ${*}.pdf || exit 0; rm -f ${*}.fo
%.fo: %.print.xml # for debugging
${SAXON6CMD} $*.print.xml ${DBOOK_XSL_CUSTOM}/pdf/docbookHdm.xsl ${dbookXslPdfParam} > $*.fo
......
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