-
Notifications
You must be signed in to change notification settings - Fork 7
/
slideshow.xsl
96 lines (86 loc) · 2.47 KB
/
slideshow.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl">
<xsl:output method="html" encoding = "UTF-8"/>
<xsl:param name="out.dir" select="'outdir'"/>
<xsl:template match="section/section">
<xsl:variable name="chunk.name"
select="@label"/>
<xsl:variable name="imgdir"
select="concat ($out.dir, '/', $chunk.name, '.rtf')"/>
<xsl:choose>
<xsl:when test="element-available('exsl:document')">
<exsl:document href = "{$imgdir}"
omit-xml-declaration = "yes"
method = "xml"
encoding = "UTF-8"
media-type = "print"
indent = "yes">
<table>
<xsl:attribute name="cellspacing">
<xsl:value-of select="'10'"/>
</xsl:attribute>
<xsl:attribute name="cellpadding">
<xsl:value-of select="'5'"/>
</xsl:attribute>
<tr>
<td>
<xsl:attribute name="valign">
<xsl:value-of select="'top'"/>
</xsl:attribute>
<!-- <xsl:text><![CDATA[<img src="&imagedir;/]]></xsl:text> -->
<img>
<xsl:attribute name="src">
<xsl:value-of select="concat('%imagedir%/', $chunk.name, '.png')"/>
</xsl:attribute>
<xsl:attribute name="width">
<xsl:value-of select="'150'"/>
</xsl:attribute>
<xsl:attribute name="valign">
<xsl:value-of select="'top'"/>
</xsl:attribute>
<!-- <xsl:text><![CDATA[>]]></xsl:text> -->
</img>
</td>
<td>
<xsl:apply-templates />
</td>
</tr>
</table>
</exsl:document>
</xsl:when>
<xsl:otherwise>
<xsl:message>exsl missing</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="section/section/title">
<h2>
<xsl:apply-templates />
</h2>
</xsl:template>
<xsl:template match="para">
<p>
<xsl:apply-templates />
</p>
</xsl:template>
<xsl:template match="itemizedlist">
<ul><xsl:apply-templates /></ul>
</xsl:template>
<xsl:template match="orderedlist">
<ol><xsl:apply-templates /></ol>
</xsl:template>
<xsl:template match="listitem">
<li><xsl:apply-templates /></li>
</xsl:template>
<xsl:template match="emphasis">
<em><xsl:apply-templates /></em>
</xsl:template>
</xsl:stylesheet>
<!--
<xsl:message>
<xsl:value-of select="$chunk.name" />
</xsl:message>
-->