forked from sickel/kodemus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylesheet-fo.xsl
79 lines (75 loc) · 2.68 KB
/
stylesheet-fo.xsl
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
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'
xmlns:fo="http://www.w3.org/1999/XSL/Format" >
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
<xsl:template match="processing-instruction('linebreak')">
<fo:block/>
</xsl:template>
<xsl:include href="user_param.xsl" />
<xsl:param name="paper.type">A4</xsl:param>
<xsl:param name="fop1.extensions">1</xsl:param>
<!-- from https://lists.oasis-open.org/archives/docbook-apps/200709/msg00055.html -->
<xsl:template name="section.heading">
<xsl:param name="level" select="1"/>
<xsl:param name="marker" select="1"/>
<xsl:param name="title"/>
<xsl:param name="marker.title"/>
<fo:block xsl:use-attribute-sets="section.title.properties">
<xsl:if test="$marker != 0">
<fo:marker marker-class-name="section.head.marker">
<xsl:copy-of select="$marker.title"/>
</fo:marker>
</xsl:if>
<xsl:choose>
<xsl:when test="$level=1">
<fo:block xsl:use-attribute-sets="section.title.level1.properties">
<xsl:if test="self::bridgehead">
<xsl:attribute name="text-align">center</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$title"/>
</fo:block>
</xsl:when>
<xsl:when test="$level=2">
<fo:block xsl:use-attribute-sets="section.title.level2.properties">
<xsl:if test="self::bridgehead">
<xsl:attribute name="text-align">center</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$title"/>
</fo:block>
</xsl:when>
<xsl:when test="$level=3">
<fo:block xsl:use-attribute-sets="section.title.level3.properties">
<xsl:if test="self::bridgehead">
<xsl:attribute name="text-align">center</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$title"/>
</fo:block>
</xsl:when>
<xsl:when test="$level=4">
<fo:block xsl:use-attribute-sets="section.title.level4.properties">
<xsl:if test="self::bridgehead">
<xsl:attribute name="text-align">center</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$title"/>
</fo:block>
</xsl:when>
<xsl:when test="$level=5">
<fo:block xsl:use-attribute-sets="section.title.level5.properties">
<xsl:if test="self::bridgehead">
<xsl:attribute name="text-align">center</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$title"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="section.title.level6.properties">
<xsl:if test="self::bridgehead">
<xsl:attribute name="text-align">center</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$title"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:template>
</xsl:stylesheet>