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

Internal XSL recactoring

parent 5299534a
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:d="http://docbook.org/ns/docbook"
xmlns:m="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="d xs"
version="2.0">
......@@ -65,5 +66,25 @@
</div> <!--goik: "footer" clickable answer modification -->
</td>
</tr>
</xsl:template>
</xsl:template>
<!-- avoid namespace prefix since some epub readers get confused. Credits to
http://stackoverflow.com/questions/16810039/how-to-remove-namespace-prefix-leaving-namespace-value-xslt
-->
<xsl:template match="m:math[not(@alttext)]" priority="2">
<xsl:element name="{local-name()}" namespace="http://www.w3.org/1998/Math/MathML">
<xsl:attribute name="alttext">math formula</xsl:attribute>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="m:*" priority="1">
<xsl:element name="{local-name()}" namespace="http://www.w3.org/1998/Math/MathML">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
......@@ -14,25 +14,7 @@
<xsl:param name="node"/>
<xsl:copy-of select="$toggleDisplayScript"/>
</xsl:template>
<!-- avoid namespace prefix since some epub readers get confused. Credits to
http://stackoverflow.com/questions/16810039/how-to-remove-namespace-prefix-leaving-namespace-value-xslt
-->
<xsl:template match="m:math[not(@alttext)]" priority="2">
<xsl:element name="{local-name()}" namespace="http://www.w3.org/1998/Math/MathML">
<xsl:attribute name="alttext">math formula</xsl:attribute>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="m:*" priority="1">
<xsl:element name="{local-name()}" namespace="http://www.w3.org/1998/Math/MathML">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="d:videoobject" priority="1">
<video controls="controls" preload="auto">
<xsl:attribute name="title">
......
<?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:m="http://www.w3.org/1998/Math/MathML"
xmlns:d="http://docbook.org/ns/docbook">
<xsl:import href="../../docbook-xsl/xhtml/chunk.xsl"/>
......@@ -11,24 +10,6 @@
<xsl:import href="../Common/common.xsl"/>
<!-- avoid namespace prefix since some epub readers get confused. Credits to
http://stackoverflow.com/questions/16810039/how-to-remove-namespace-prefix-leaving-namespace-value-xslt
-->
<xsl:template match="m:math[not(@alttext)]" priority="2">
<xsl:element name="{local-name()}" namespace="http://www.w3.org/1998/Math/MathML">
<xsl:attribute name="alttext">math formula</xsl:attribute>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="m:*" priority="1">
<xsl:element name="{local-name()}" namespace="http://www.w3.org/1998/Math/MathML">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="//d:chapter[contains(@annotations, 'slide')]|
//d:section[contains(@annotations, 'slide')]"
......@@ -41,13 +22,6 @@
<xsl:template match="d:chapter | d:section" mode='selectedSlideSet'>
<xsl:result-document method="xhtml" encoding="utf-8" href="Slides/{@xml:id}.html" indent="no">
<xsl:message>
<xsl:text>Processing </xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>, id=</xsl:text>
<xsl:value-of select="@xml:id"/>
</xsl:message>
<html lang="en">
<head>
<title>
......@@ -106,12 +80,6 @@
<xsl:template match="d:chapter | d:section" mode='slideSet'>
<xsl:result-document method="xhtml" encoding="utf-8" href="Slides/{@xml:id}.html" indent="no">
<xsl:message>
<xsl:text>Processing </xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>, id=</xsl:text>
<xsl:value-of select="@xml:id"/>
</xsl:message>
<html lang="en">
<head>
......@@ -176,7 +144,6 @@
<xsl:template match="d:title" mode="slideDescendants"/>
<xsl:template match="*" mode="slideDescendants">
<xsl:message>AAAAAAAAAAAAA <xsl:value-of select="name(.)"/></xsl:message>
<section>
<xsl:attribute name="xml:id">
<xsl:choose>
......
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