aboutsummaryrefslogtreecommitdiff
path: root/share/xml/freebsd-epub.xsl
blob: ce562d58ded9a214ee89ccef56e89ca0d44d1f70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version='1.0'?>

<!-- $FreeBSD$ -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:str="http://exslt.org/strings"
		xmlns:db="http://docbook.org/ns/docbook"
		xmlns="http://www.w3.org/1999/xhtml"
		exclude-result-prefixes="db str"
		extension-element-prefixes="str"
                version='1.0'>

  <!-- Pull in the base stylesheets -->
  <xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/epub3/chunk.xsl"/>

  <!-- Pull in common XHTML customizations -->
  <xsl:import href="freebsd-xhtml-common.xsl"/>

  <!-- The localization layer is the same preference level of this file -->
  <xsl:include href="http://www.FreeBSD.org/XML/lang/share/xml/freebsd-epub.xsl"/>

  <xsl:param name="generate.legalnotice.link" select="'1'"/>

  <xsl:param name="docbook.css.source">../xml/docbook-epub.css.xml</xsl:param>
  <xsl:param name="formal.title.placement">
figure after
example before
equation after
table before
procedure before
  </xsl:param>
  <xsl:param name="variablelist.term.break.after" select="1"/>
  <xsl:param name="variablelist.term.separator"/>

  <!--
	XXX: $docbook.css.source source is interpreted as a relative path
	when referenced from a template and it should be relative to
	this stylesheets and not the stock one, so xopy this file here.
  -->
  <xsl:template name="generate.default.css.file">
    <xsl:if test="$make.clean.html != 0 and 
                  $generate.css.header = 0 and
                  $docbook.css.source != ''">
      <!-- Select default file relative to stylesheet -->
      <xsl:variable name="css.node" select="document($docbook.css.source)/*[1]"/>
      <xsl:variable name="fname" select="str:tokenize($docbook.css.source, '/')[last()]"/>

      <xsl:call-template name="generate.css.file">
        <xsl:with-param name="src" select="$fname"/>
        <xsl:with-param name="css.node" select="$css.node"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

  <xsl:template name="make.css.link">
    <xsl:param name="css.filename" select="''"/>

    <xsl:variable name="href" select="substring-before(str:tokenize($docbook.css.source, '/')[last()], '.xml')"/>

    <xsl:if test="string-length($css.filename) != 0">
      <link rel="stylesheet" type="text/css" href="{$href}"/>
    </xsl:if>
  </xsl:template>

<xsl:template name="user.footer.navigation"/>
</xsl:stylesheet>