-
Notifications
You must be signed in to change notification settings - Fork 2
/
talks2html.xsl
45 lines (37 loc) · 1.08 KB
/
talks2html.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
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="utf-8"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="talk|date|abstract|example">
<div class="{name()}">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="presenter">
<div class="presenter"><span class="label">Presenter:</span><xsl:text>
</xsl:text><xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="topic">
<div class="topic"><span class="label">Topic:</span><xsl:text>
</xsl:text>
<xsl:choose>
<xsl:when test="@href">
<a href="{@href}"><xsl:value-of select="title"/></a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</div>
<xsl:apply-templates/>
</xsl:template>
<!-- already processed -->
<xsl:template match="title"/>
<!-- don't processed -->
<xsl:template match="attendees|sponsor"/>
</xsl:stylesheet>