xml version encoding utf-8 xsl stylesheet version xmlns xsl http www w

 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
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:n='http://mrShadow.habrahabr.ru/notes3/'
exclude-result-prefixes='n'>
<xsl:output method='html' encoding='utf-8' indent='no'
doctype-public='-//W3C//DTD HTML 4.01//EN'
doctype-system='http://www.w3.org/TR/html4/strict.dtd'/>
<xsl:template match='n:notes'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>Заметки</title>
<link rel='shortcut icon' href='favicon.png'/>
<link rel='stylesheet' type='text/css' href='style.css'/>
<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript' src='script.js'></script>
</head>
<body>
<h1>Заметки</h1>
<div id='tags_header'>
Метки:
<a href='' id='toggle_tags'>Скрыть</a>
<xsl:text> </xsl:text>
<a href='' id='toggle_popular_tags' class='active_link'>Популярные</a>
<xsl:text> </xsl:text>
<a href='' id='toggle_all_tags'>Все</a>
<div id='popular_tags'/>
<div id='all_tags'/>
</div>
<div id='chosen_tags'>
Фильтр:
</div>
<xsl:apply-templates select='n:note'/>
</body>
</html>
</xsl:template>
<xsl:template match='n:note'>
<div id='notes'>
<table class='note'>
<tr>
<td class='note_header_td'>
<div class='note_header'>
<xsl:if test='n:date'>
<div class='note_date'><xsl:value-of select='n:date'/></div>
</xsl:if>
<div class='note_title'>
<xsl:choose>
<xsl:when test='n:link'>
<xsl:element name='a'>
<xsl:attribute name='href'><xsl:value-of select='n:link'/></xsl:attribute>
<xsl:value-of select='n:title'/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select='n:title'/>
</xsl:otherwise>
</xsl:choose>
</div>
</div>
</td>
</tr>
<tr>
<td class='note_contents'><xsl:copy-of select='n:content'/></td>
</tr>
<tr>
<td class='note_tags'>
<xsl:for-each select='n:tags/n:tag'>
<a class='note_tag' href=''><xsl:value-of select='.'/></a>
<xsl:text> </xsl:text>
</xsl:for-each>
</td>
</tr>
</table>
</div>
</xsl:template>
</xsl:stylesheet>