Mercurial > hg > nginx-site
annotate xslt/directive.xslt @ 1017:9f9a427a73eb
Fixed broken links to chinese versions of some modules.
The chinese version contains untranslated copies of english documentation for
random_index and realip modules. The result is the appearance of 'translation
to chinese' link for this modules pointing to non-existing document. This
files are removed.
Also, broken links are generated for the chinese version of the "flv" module,
but the translation exists, although not enabled for publication. Since
contents of file looks like a valid translation, it is allowed to be published.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Mon, 18 Nov 2013 12:48:10 +0400 |
parents | 13f4de67fbb6 |
children | c454373427ef |
rev | line source |
---|---|
170 | 1 <?xml version="1.0" encoding="utf-8"?> |
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
3 | |
4 <xsl:template match="directive"> | |
5 | |
6 <a name="{@name}"/> | |
7 <!-- <center><h4><xsl:value-of select="@name"/> </h4></center> --> | |
8 | |
9 <div class="directive"> | |
10 | |
11 <table cellspacing="0"> | |
12 | |
13 <xsl:apply-templates select="syntax"/> | |
14 | |
15 <xsl:apply-templates select="default"/> | |
16 | |
17 <xsl:apply-templates select="context"/> | |
18 | |
19 </table> | |
20 | |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
21 <xsl:apply-templates select="appeared-in"/> |
170 | 22 |
23 </div> | |
24 | |
25 <xsl:apply-templates select="para"/> | |
26 </xsl:template> | |
27 | |
28 <xsl:template match="syntax"> | |
29 | |
30 <xsl:if test="position() = 1"> | |
31 | |
32 <xsl:text disable-output-escaping="yes"> | |
33 <tr> | |
34 <td> | |
35 </xsl:text> | |
36 | |
37 <xsl:value-of select="document(concat($XML, '/i18n.xml')) /i18n/text[@lang = $LANG]/item[@id='syntax']"/> | |
38 | |
39 <xsl:text>:</xsl:text> | |
40 | |
41 <xsl:text disable-output-escaping="yes"> | |
42 </td> | |
43 <td> | |
44 </xsl:text> | |
45 </xsl:if> | |
46 | |
47 <code> | |
48 | |
49 <strong> | |
50 | |
51 <xsl:value-of select="../@name"/> | |
52 | |
53 </strong> | |
54 | |
55 <xsl:if test="count(node()) != 0"> | |
56 | |
57 <xsl:text> </xsl:text> | |
58 <xsl:apply-templates/> | |
59 </xsl:if> | |
60 <xsl:choose> | |
61 | |
62 <xsl:when test="@block = 'yes'"> | |
63 | |
64 <xsl:text> { ... }</xsl:text> | |
65 </xsl:when> | |
66 | |
67 <xsl:otherwise> | |
68 | |
69 <xsl:text>;</xsl:text> | |
70 </xsl:otherwise> | |
71 </xsl:choose> | |
72 | |
73 </code> | |
74 | |
75 <br/> | |
76 | |
77 <xsl:if test="position() = last()"> | |
78 | |
79 <xsl:text disable-output-escaping="yes"> | |
80 </td> | |
81 </tr> | |
82 </xsl:text> | |
83 </xsl:if> | |
84 </xsl:template> | |
85 | |
86 <xsl:template match="default"> | |
87 | |
88 <xsl:if test="position() = 1"> | |
89 | |
90 <xsl:text disable-output-escaping="yes"> | |
91 <tr> | |
92 <td> | |
93 </xsl:text> | |
94 | |
95 <xsl:value-of select="document(concat($XML, '/i18n.xml')) /i18n/text[@lang = $LANG]/item[@id='default']"/> | |
96 | |
97 <xsl:text>:</xsl:text> | |
98 | |
99 <xsl:text disable-output-escaping="yes"> | |
100 </td> | |
101 <td> | |
102 </xsl:text> | |
103 </xsl:if> | |
104 <xsl:choose> | |
105 | |
106 <xsl:when test="count(node()) = 0"> | |
107 —</xsl:when> | |
108 | |
109 <xsl:otherwise> | |
110 | |
111 <pre> | |
112 | |
113 <xsl:value-of select="../@name"/> | |
114 <xsl:choose> | |
115 | |
116 <xsl:when test="count(../syntax[@block='yes'])"> | |
117 | |
118 <xsl:text> {</xsl:text> | |
119 <xsl:apply-templates/> | |
120 <xsl:text>}</xsl:text> | |
121 </xsl:when> | |
122 | |
123 <xsl:otherwise> | |
124 | |
125 <xsl:text> </xsl:text> | |
126 <xsl:apply-templates/> | |
127 <xsl:text>;</xsl:text> | |
128 </xsl:otherwise> | |
129 </xsl:choose> | |
130 | |
131 </pre> | |
132 </xsl:otherwise> | |
133 </xsl:choose> | |
134 | |
135 <xsl:if test="position() = last()"> | |
136 | |
137 <xsl:text disable-output-escaping="yes"> | |
138 </td> | |
139 </tr> | |
140 </xsl:text> | |
141 </xsl:if> | |
142 </xsl:template> | |
143 | |
144 <xsl:template match="context"> | |
145 | |
146 <xsl:if test="position() = 1"> | |
147 | |
148 <xsl:text disable-output-escaping="yes"> | |
149 <tr> | |
150 <td> | |
151 </xsl:text> | |
152 | |
153 <xsl:value-of select="document(concat($XML, '/i18n.xml')) /i18n/text[@lang = $LANG]/item[@id='context']"/> | |
154 | |
155 <xsl:text>:</xsl:text> | |
156 | |
157 <xsl:text disable-output-escaping="yes"> | |
158 </td> | |
159 <td> | |
160 </xsl:text> | |
161 </xsl:if> | |
162 | |
163 <code> | |
164 <xsl:choose> | |
165 | |
166 <xsl:when test="count(node()) = 0"> | |
167 | |
168 <xsl:value-of select="document(concat($XML, '/i18n.xml')) /i18n/text[@lang = $LANG]/item[@id='context.any']"/> | |
169 </xsl:when> | |
170 | |
171 <xsl:otherwise> | |
172 | |
173 <xsl:apply-templates/> | |
174 </xsl:otherwise> | |
175 </xsl:choose> | |
176 | |
177 </code> | |
178 <xsl:choose> | |
179 | |
180 <xsl:when test="position() != last()"> | |
181 | |
182 <xsl:text>, </xsl:text> | |
183 </xsl:when> | |
184 | |
185 <xsl:otherwise> | |
186 | |
187 <br/> | |
188 | |
189 <xsl:text disable-output-escaping="yes"> | |
190 </td> | |
191 </tr> | |
192 </xsl:text> | |
193 </xsl:otherwise> | |
194 </xsl:choose> | |
195 </xsl:template> | |
196 | |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
197 <xsl:template match="appeared-in"> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
198 <xsl:choose> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
199 |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
200 <xsl:when test="last() = 1"> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
201 |
177
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
202 <p> |
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
203 |
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
204 <xsl:value-of select="document(concat($XML, '/i18n.xml')) /i18n/text[@lang = $LANG]/item [@id='directive.version']"/> |
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
205 |
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
206 <xsl:text> </xsl:text> |
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
207 |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
208 <xsl:apply-templates/>. |
177
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
209 |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
210 </p> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
211 </xsl:when> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
212 |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
213 <xsl:otherwise> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
214 |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
215 <xsl:choose> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
216 <xsl:when test="position() = 1"> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
217 <xsl:text disable-output-escaping="yes"> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
218 <p> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
219 </xsl:text> |
177
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
220 <xsl:value-of select="document(concat($XML, '/i18n.xml')) /i18n/text[@lang = $LANG]/item [@id='directive.versions']"/> |
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
221 <xsl:text> </xsl:text> |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
222 <xsl:apply-templates/> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
223 <xsl:if test="last() > 2"> |
177
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
224 <xsl:text>,</xsl:text> |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
225 </xsl:if> |
177
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
226 <xsl:text> </xsl:text> |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
227 </xsl:when> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
228 <xsl:when test="position() != last()"> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
229 <xsl:apply-templates/> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
230 <xsl:text>, </xsl:text> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
231 </xsl:when> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
232 <xsl:otherwise> |
177
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
233 <xsl:value-of select="document(concat($XML, '/i18n.xml')) /i18n/text[@lang = $LANG]/item [@id='and']"/> |
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
234 <xsl:text> </xsl:text> |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
235 <xsl:apply-templates/>. |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
236 <xsl:text disable-output-escaping="yes"> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
237 </p> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
238 </xsl:text> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
239 </xsl:otherwise> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
240 </xsl:choose> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
241 </xsl:otherwise> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
242 </xsl:choose> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
243 </xsl:template> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
244 |
170 | 245 </xsl:stylesheet> |