Mercurial > hg > nginx-quic
annotate docs/xslt/changes.xslt @ 4366:8aab24694c91 stable-1.0
Merge of r4313:
Added escaping of double quotes in ngx_escape_html().
Patch by Zaur Abasmirzoev.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 14 Dec 2011 18:04:06 +0000 |
parents | f872a86a655c |
children |
rev | line source |
---|---|
450 | 1 <?xml version="1.0" encoding="utf-8"?> |
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
3 | |
4048
f872a86a655c
CHANGES conversion from KOI8-R to UTF-8.
Igor Sysoev <igor@sysoev.ru>
parents:
4047
diff
changeset
|
4 <xsl:output method="text"/> |
450 | 5 |
6 <xsl:param select="'en'" name="lang"/> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
7 |
450 | 8 <xsl:param select="'../xml/change_log_conf.xml'" name="configuration"/> |
9 | |
10 <xsl:variable select="document($configuration)/configuration" name="conf"/> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
11 |
450 | 12 <xsl:variable select="$conf/start" name="start"/> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
13 |
450 | 14 <xsl:variable select="$conf/indent" name="indent"/> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
15 |
450 | 16 <xsl:variable select="$conf/length" name="max"/> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
17 |
450 | 18 <xsl:variable name="br"><br></xsl:variable> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
19 |
450 | 20 <xsl:template match="/"> |
21 <xsl:apply-templates select="change_log"/> | |
22 </xsl:template> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
23 |
450 | 24 <xsl:template match="change_log"> |
25 <xsl:apply-templates select="changes"/> | |
26 </xsl:template> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
27 |
450 | 28 <xsl:template match="changes"> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
29 |
450 | 30 <xsl:text> |
31 </xsl:text> | |
32 | |
33 <xsl:value-of select="substring(concat($conf/changes[@lang=$lang]/title, //change_log/@title, ' ', @ver, ' '), 1, $conf/changes[@lang=$lang]/length)"/> | |
34 | |
35 <xsl:if test="$lang='ru'"> | |
36 <xsl:value-of select="@date"/> | |
37 </xsl:if> | |
38 | |
39 <xsl:if test="$lang='en'"> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
40 |
450 | 41 <xsl:value-of select="substring(@date, 1, 2)"/> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
42 |
450 | 43 <xsl:value-of select="$conf/changes[@lang=$lang]/month[number(substring(current()/@date, 4, 2))]"/> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
44 |
450 | 45 <xsl:value-of select="substring(@date, 7, 4)"/> |
46 </xsl:if> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
47 |
450 | 48 <xsl:text> |
49 </xsl:text> | |
50 | |
51 <xsl:apply-templates select="change"/> | |
52 | |
53 <xsl:text> | |
54 </xsl:text> | |
55 </xsl:template> | |
56 | |
57 <xsl:template match="change"> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
58 |
450 | 59 <xsl:variable select="$conf/changes[@lang=$lang]/*[local-name(.)=current()/@type]" name="prefix"/> |
60 | |
61 <xsl:variable name="postfix"> | |
62 <xsl:if test="$prefix"> | |
63 <xsl:text>: </xsl:text> | |
64 </xsl:if> | |
65 </xsl:variable> | |
66 | |
67 <xsl:apply-templates select="para[@lang=$lang]"> | |
68 <xsl:with-param select="concat($start, $prefix, $postfix)" name="prefix"/> | |
69 </xsl:apply-templates> | |
70 </xsl:template> | |
71 | |
72 <xsl:template match="para" name="para"> | |
73 <xsl:param name="prefix"/> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
74 |
450 | 75 <xsl:variable name="text"> |
76 <xsl:apply-templates/> | |
77 </xsl:variable> | |
78 | |
79 <xsl:text> | |
80 </xsl:text> | |
81 | |
82 <xsl:call-template name="wrap"> | |
83 <xsl:with-param select="normalize-space($text)" name="text"/> | |
84 <xsl:with-param name="prefix"> | |
85 <xsl:choose> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
86 |
450 | 87 <xsl:when test="position() = 1"> |
88 <xsl:value-of select="$prefix"/> | |
89 </xsl:when> | |
90 <xsl:otherwise> | |
91 <xsl:value-of select="$indent"/> | |
92 </xsl:otherwise> | |
93 </xsl:choose> | |
94 </xsl:with-param> | |
95 </xsl:call-template> | |
96 </xsl:template> | |
97 | |
98 <xsl:template name="wrap"> | |
99 <xsl:param name="text"/> | |
100 <xsl:param name="prefix"/> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
101 |
450 | 102 <xsl:if test="$text"> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
103 |
450 | 104 <xsl:variable name="offset"> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
105 |
450 | 106 <xsl:choose> |
107 <xsl:when test="starts-with($text, concat($br, ' '))"> | |
108 <xsl:value-of select="string-length($br) + 2"/> | |
109 </xsl:when> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
110 <xsl:when test="starts-with($text, $br)"> |
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
111 <xsl:value-of select="string-length($br) + 1"/> |
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
112 </xsl:when> |
450 | 113 <xsl:otherwise> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
114 1</xsl:otherwise> |
450 | 115 </xsl:choose> |
116 </xsl:variable> | |
117 | |
118 <xsl:variable name="length"> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
119 |
450 | 120 <xsl:call-template name="length"> |
121 <xsl:with-param select="substring($text, $offset)" name="text"/> | |
122 <xsl:with-param select="string-length($prefix)" name="prefix"/> | |
123 <xsl:with-param select="$max" name="length"/> | |
124 </xsl:call-template> | |
125 </xsl:variable> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
126 |
450 | 127 <xsl:value-of select="$prefix"/> |
128 | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
129 <xsl:value-of select="normalize-space(translate(substring($text, $offset, $length), ' ', ' '))"/> |
450 | 130 |
131 <xsl:text> | |
132 </xsl:text> | |
133 | |
134 <xsl:call-template name="wrap"> | |
135 <xsl:with-param select="substring($text, $length + $offset)" name="text"/> | |
136 <xsl:with-param select="$indent" name="prefix"/> | |
137 </xsl:call-template> | |
138 </xsl:if> | |
139 </xsl:template> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
140 |
450 | 141 <xsl:template name="length"> |
142 <xsl:param name="text"/> | |
143 <xsl:param name="prefix"/> | |
144 <xsl:param name="length"/> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
145 |
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
146 <xsl:variable select="substring-before(substring($text, 1, $length - $prefix + string-length($br)), $br)" name="break"/> |
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
147 |
450 | 148 <xsl:choose> |
149 <xsl:when test="$break"> | |
150 <xsl:value-of select="string-length($break)"/> | |
151 </xsl:when> | |
152 <xsl:when test="$length = 0"> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
153 <xsl:value-of select="$max - $prefix"/> |
450 | 154 </xsl:when> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
155 <xsl:when test="string-length($text) + $prefix <= $length"> |
450 | 156 <xsl:value-of select="$length - $prefix"/> |
157 </xsl:when> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
158 <xsl:when test="substring($text, $length - $prefix + 1, 1) = ' '"> |
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
159 <xsl:value-of select="$length - $prefix + 1"/> |
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
160 </xsl:when> |
450 | 161 <xsl:otherwise> |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
162 |
450 | 163 <xsl:call-template name="length"> |
164 <xsl:with-param select="$text" name="text"/> | |
165 <xsl:with-param select="$prefix" name="prefix"/> | |
166 <xsl:with-param select="$length - 1" name="length"/> | |
167 </xsl:call-template> | |
168 </xsl:otherwise> | |
169 </xsl:choose> | |
170 </xsl:template> | |
171 | |
172 <xsl:template match="at">@</xsl:template> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
173 |
450 | 174 <xsl:template match="br"> |
175 <xsl:value-of select="$br"/> | |
176 </xsl:template> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
177 |
450 | 178 <xsl:template match="nobr"> |
179 <xsl:value-of select="translate(., ' ', ' ')"/> | |
180 </xsl:template> | |
4047
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
181 |
3e706fcccbf3
Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Igor Sysoev <igor@sysoev.ru>
parents:
450
diff
changeset
|
182 </xsl:stylesheet> |