-
Notifications
You must be signed in to change notification settings - Fork 0
/
org2cesnet.xsl
40 lines (33 loc) · 1.2 KB
/
org2cesnet.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
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:param name="wwwpath">https://www.cesnet.cz/doc/tr/</xsl:param>
<xsl:param name="year">2011</xsl:param>
<!-- Root element -->
<xsl:template match="/xh:html">
<xsl:comment>#include virtual="/i-start1.html"</xsl:comment>
<xsl:copy-of select="xh:head/xh:title"/>
<xsl:comment>#include virtual="/i-start2.html"</xsl:comment>
<xsl:apply-templates select="xh:body"/>
<xsl:comment>#include virtual="/i-stop.html"</xsl:comment>
</xsl:template>
<xsl:template match="xh:body">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="xh:h3/xh:span[@class='target']">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="concat($wwwpath,$year,'/',.)"/>
</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>