Mercurial > hg > nginx-site
annotate xslt/directive.xslt @ 2837:92e5dca02091
Corrected syntax of ssl_conf_command and friends.
author | Dj Gilcrease <d.gilcrease@f5.com> |
---|---|
date | Fri, 18 Feb 2022 11:24:41 -0800 |
parents | cc81d1570f3e |
children |
rev | line source |
---|---|
170 | 1 <?xml version="1.0" encoding="utf-8"?> |
1085 | 2 <!-- |
3 Copyright (C) Igor Sysoev | |
4 Copyright (C) Nginx, Inc. | |
5 --> | |
6 | |
170 | 7 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
8 | |
1085 | 9 <xsl:template match="directive"> |
10 <a name="{@name}"/> | |
11 <!-- <center><h4> !{@name} </h4></center> --> | |
12 <div class="directive"> | |
13 <table cellspacing="0"> | |
14 <xsl:apply-templates select="syntax"/> | |
15 <xsl:apply-templates select="default"/> | |
16 <xsl:apply-templates select="context"/> | |
17 </table> | |
18 <xsl:apply-templates select="appeared-in"/> | |
19 </div> | |
20 <xsl:apply-templates select="para"/> | |
21 </xsl:template> | |
170 | 22 |
1085 | 23 <xsl:template match="syntax"> |
24 <xsl:if test="position() = 1"> | |
25 <xsl:text disable-output-escaping="yes"> | |
170 | 26 <tr> |
1223 | 27 <th> |
170 | 28 </xsl:text> |
1085 | 29 <xsl:value-of select="document(concat($XML, '/i18n.xml')) |
30 /i18n/text[@lang = $LANG]/item[@id='syntax']"/> | |
31 <xsl:text>:</xsl:text> | |
32 <xsl:text disable-output-escaping="yes"> | |
1223 | 33 </th> |
170 | 34 <td> |
35 </xsl:text> | |
1085 | 36 </xsl:if> |
37 <code> | |
38 <strong> | |
39 <xsl:value-of select="../@name"/> | |
40 </strong> | |
41 <xsl:if test="count(node()) != 0"> | |
42 <xsl:text> </xsl:text> <xsl:apply-templates/> | |
43 </xsl:if> | |
44 <xsl:choose><xsl:when test="@block = 'yes'"> | |
45 <xsl:text> { ... }</xsl:text> | |
46 </xsl:when><xsl:otherwise> | |
47 <xsl:text>;</xsl:text> | |
48 </xsl:otherwise></xsl:choose> | |
49 </code> | |
50 <br/> | |
51 <xsl:if test="position() = last()"> | |
170 | 52 <xsl:text disable-output-escaping="yes"> |
53 </td> | |
54 </tr> | |
55 </xsl:text> | |
1085 | 56 </xsl:if> |
57 </xsl:template> | |
170 | 58 |
1085 | 59 <xsl:template match="default"> |
60 <xsl:if test="position() = 1"> | |
61 <xsl:text disable-output-escaping="yes"> | |
62 <tr> | |
1223 | 63 <th> |
1085 | 64 </xsl:text> |
65 <xsl:value-of select="document(concat($XML, '/i18n.xml')) | |
66 /i18n/text[@lang = $LANG]/item[@id='default']"/> | |
67 <xsl:text>:</xsl:text> | |
68 <xsl:text disable-output-escaping="yes"> | |
1223 | 69 </th> |
1085 | 70 <td> |
71 </xsl:text> | |
72 </xsl:if> | |
73 <xsl:choose><xsl:when test="count(node()) = 0"> | |
74 — | |
75 </xsl:when><xsl:otherwise> | |
76 <pre> | |
77 <xsl:value-of select="../@name"/> | |
78 <xsl:choose><xsl:when test="count(../syntax[@block='yes'])"> | |
79 <xsl:text> {</xsl:text> <xsl:apply-templates/> <xsl:text>}</xsl:text> | |
80 </xsl:when><xsl:otherwise> | |
81 <xsl:text> </xsl:text> <xsl:apply-templates/> <xsl:text>;</xsl:text> | |
82 </xsl:otherwise></xsl:choose> | |
83 </pre> | |
84 </xsl:otherwise></xsl:choose> | |
85 <xsl:if test="position() = last()"> | |
86 <xsl:text disable-output-escaping="yes"> | |
87 </td> | |
88 </tr> | |
89 </xsl:text> | |
90 </xsl:if> | |
91 </xsl:template> | |
177
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
92 |
1085 | 93 <xsl:template match="context"> |
94 <xsl:if test="position() = 1"> | |
95 <xsl:text disable-output-escaping="yes"> | |
96 <tr> | |
1223 | 97 <th> |
1085 | 98 </xsl:text> |
99 <xsl:value-of select="document(concat($XML, '/i18n.xml')) | |
100 /i18n/text[@lang = $LANG]/item[@id='context']"/> | |
101 <xsl:text>:</xsl:text> | |
102 <xsl:text disable-output-escaping="yes"> | |
1223 | 103 </th> |
1085 | 104 <td> |
105 </xsl:text> | |
106 </xsl:if> | |
107 <code> | |
108 <xsl:choose><xsl:when test="count(node()) = 0"> | |
109 <xsl:value-of select="document(concat($XML, '/i18n.xml')) | |
110 /i18n/text[@lang = $LANG]/item[@id='context.any']"/> | |
111 </xsl:when><xsl:otherwise> | |
112 <xsl:apply-templates/> | |
113 </xsl:otherwise></xsl:choose> | |
114 </code> | |
115 <xsl:choose><xsl:when test="position() != last()"> | |
116 <xsl:text>, </xsl:text> | |
117 </xsl:when><xsl:otherwise> | |
118 <br/> | |
119 <xsl:text disable-output-escaping="yes"> | |
120 </td> | |
121 </tr> | |
122 </xsl:text> | |
123 </xsl:otherwise></xsl:choose> | |
124 </xsl:template> | |
177
13f4de67fbb6
Added i18n support for multiple <appeared-in> inside <directive>.
Ruslan Ermilov <ru@nginx.com>
parents:
171
diff
changeset
|
125 |
1085 | 126 <xsl:template match="appeared-in"> |
127 <xsl:choose><xsl:when test="last() = 1"> | |
128 <p> | |
129 <xsl:value-of select="document(concat($XML, '/i18n.xml')) | |
130 /i18n/text[@lang = $LANG]/item | |
131 [@id='directive.version']"/> | |
132 <xsl:text> </xsl:text> | |
133 <xsl:apply-templates/>. | |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
134 </p> |
1085 | 135 </xsl:when><xsl:otherwise> |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
136 <xsl:choose> |
1085 | 137 <xsl:when test="position() = 1"> |
138 <xsl:text disable-output-escaping="yes"> | |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
139 <p> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
140 </xsl:text> |
1085 | 141 <xsl:value-of select="document(concat($XML, '/i18n.xml')) |
142 /i18n/text[@lang = $LANG]/item | |
143 [@id='directive.versions']"/> | |
144 <xsl:text> </xsl:text> | |
145 <xsl:apply-templates/> | |
146 <xsl:if test="last() > 2"> | |
147 <xsl:text>,</xsl:text> | |
148 </xsl:if> | |
149 <xsl:text> </xsl:text> | |
150 </xsl:when> | |
151 <xsl:when test="position() != last()"> | |
152 <xsl:apply-templates/> | |
153 <xsl:text>, </xsl:text> | |
154 </xsl:when> | |
155 <xsl:otherwise> | |
156 <xsl:value-of select="document(concat($XML, '/i18n.xml')) | |
157 /i18n/text[@lang = $LANG]/item | |
158 [@id='and']"/> | |
159 <xsl:text> </xsl:text> | |
160 <xsl:apply-templates/>. | |
161 <xsl:text disable-output-escaping="yes"> | |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
162 </p> |
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
163 </xsl:text> |
1085 | 164 </xsl:otherwise> |
171
6eeaa9e1f3b5
Made "appeared-in" an element, and added support for
Ruslan Ermilov <ru@nginx.com>
parents:
170
diff
changeset
|
165 </xsl:choose> |
1085 | 166 </xsl:otherwise></xsl:choose> |
167 </xsl:template> | |
170 | 168 </xsl:stylesheet> |