-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathto_about_html_snippet.xsl
64 lines (61 loc) · 2.9 KB
/
to_about_html_snippet.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
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common" exclude-result-prefixes="exsl">
<xsl:import href="to_commons.xsl"/>
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"/>
<!-- parameters -->
<xsl:param name="extension"/>
<xsl:param name="extension-href"/>
<xsl:param name="info-file"/>
<xsl:param name="temp-dir"/>
<!-- create about.html snippet -->
<xsl:template match="/">
<table>
<xsl:call-template name="to-model">
<xsl:with-param name="extension" select="$extension"/>
<xsl:with-param name="info-file" select="$info-file"/>
<xsl:with-param name="temp-dir" select="$temp-dir"/>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template match="extension" mode="model">
<xsl:key name="k" match="language" use="concat(@configuration-file, @file)"/>
<xsl:for-each select="*[@duplicate = 0]">
<tr>
<td><xsl:value-of select="concat(@configuration-file, @file)"/></td>
<xsl:if test="position() = 1">
<td>
<xsl:if test="count(../*[@duplicate = 0]) > 1">
<xsl:attribute name="rowspan">
<xsl:value-of select="count(../*[@duplicate = 0])"/>
</xsl:attribute>
</xsl:if>
<a href="{$extension-href}" target="_blank"><xsl:value-of select="$extension"/></a>
</td>
</xsl:if>
<td>
<a href="{$extension-href}/{@configuration-path}{@path}" target="_blank">
<xsl:call-template name="basename">
<xsl:with-param name="path" select="concat(@configuration-path, @path)"/>
</xsl:call-template>
</a>
</td>
<td>
<xsl:choose>
<xsl:when test="@original-href">
<a href="{@original-href}">
<xsl:call-template name="decode">
<xsl:with-param name="path">
<xsl:call-template name="basename">
<xsl:with-param name="path" select="@original-href"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</a>
</xsl:when>
<xsl:when test="name() = 'language'"><xsl:text>-</xsl:text></xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>