-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert_2_html.xsl
93 lines (92 loc) · 2.18 KB
/
convert_2_html.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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="UTF-8" indent="yes"/>
<!--
xslt for transform into a html page.
useful if your friends are asking if their brand new device is supported by WURFL
send comments, questions to roland guelle <[email protected]>
-->
<xsl:template match="/">
<html>
<head>
<title>
<xsl:value-of select="/wurfl/version/ver"/>
</title>
</head>
<body>
<div>
<h1>
<xsl:value-of select="/wurfl/version/ver"/>
</h1>
<xsl:apply-templates select="/wurfl/version"/>
<xsl:apply-templates select="/wurfl/devices/device"/>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="device">
<div>
<h5>
<xsl:value-of select="@id"/>
</h5>
<ul>
<li>
<xsl:for-each select="@*">
<xsl:value-of select="name()"/>
<xsl:text>="</xsl:text>
<xsl:value-of select="."/>
<xsl:text>" </xsl:text>
</xsl:for-each>
<!-- group -->
<xsl:for-each select="*">
<ul>
<li>
<xsl:for-each select="@*">
<xsl:value-of select="name()"/>
<xsl:text>="</xsl:text>
<xsl:value-of select="."/>
<xsl:text>"</xsl:text>
<br/>
</xsl:for-each>
<!-- caps -->
<xsl:for-each select="*">
<ul>
<li>
<xsl:value-of select="@name"/>
<xsl:text>="</xsl:text>
<xsl:value-of select="@value"/>
<xsl:text>"</xsl:text>
<br/>
</li>
</ul>
</xsl:for-each>
</li>
</ul>
</xsl:for-each>
</li>
</ul>
</div>
</xsl:template>
<xsl:template match="version">
<hr/>
<h4>
<a href="{official_url}">
<xsl:value-of select="ver"/>
</a>
</h4>
<h4>
<xsl:value-of select="last_updated"/>
</h4>
<p>
<xsl:value-of select="statement"/>
</p>
<p>
<h5>Maintainer</h5>
<ul>
<xsl:for-each select="maintainers/maintainer">
<li><xsl:value-of select="@name"/>/ <a href="{@home_page}">www</a></li>
</xsl:for-each>
</ul>
</p>
</xsl:template>
</xsl:stylesheet>