comparison xml/en/docs/http/ngx_http_xslt_module.xml @ 377:e72701967099

English translation of ngx_http_xslt_module.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 30 Jan 2012 12:11:46 +0000
parents
children dd9fec875834
comparison
equal deleted inserted replaced
376:a837069db70d 377:e72701967099
1 <?xml version="1.0"?>
2
3 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
4
5 <module name="Module ngx_http_xslt_module"
6 link="/en/docs/http/ngx_http_xslt_module.html"
7 lang="en">
8
9 <section id="summary">
10
11 <para>
12 The <literal>ngx_http_xslt_module</literal> (0.7.8+) is a filter
13 that transforms XML responses using one or more XSLT stylesheets.
14 </para>
15
16 <para>
17 This module is not built by default, it should be enabled with the
18 <literal>--with-http_xslt_module</literal>
19 configuration parameter.
20 <note>
21 This module requires the
22 <link url="http://www.xmlsoft.org">libxml2 and libxslt</link> libraries.
23 </note>
24 </para>
25
26 </section>
27
28
29 <section id="example" name="Example Configuration">
30
31 <para>
32 <example>
33 location / {
34 xml_entities /site/dtd/entities.dtd;
35 xslt_stylesheet /site/xslt/one.xslt param=value;
36 xslt_stylesheet /site/xslt/two.xslt;
37 }
38 </example>
39 </para>
40
41 </section>
42
43
44 <section id="directives" name="Directives">
45
46 <directive name="xml_entities">
47 <syntax><value>path</value></syntax>
48 <default/>
49 <context>http</context>
50 <context>server</context>
51 <context>location</context>
52
53 <para>
54 Specifies the DTD file that declares character entities.
55 This file is compiled during the configuration stage.
56 For technical reasons the module is unable to use the
57 external subset declared in the processed XML, so it is
58 ignored and instead a specially defined file is used.
59 This file should not describe the XML structure, it is
60 enough to only declare the required character entities, for example:
61 <example>
62 &lt;!ENTITY nbsp "&amp;#xa0;"&gt;
63 </example>
64 </para>
65
66 </directive>
67
68
69 <directive name="xslt_stylesheet">
70 <syntax>
71 <value>stylesheet</value>
72 [<value>parameter</value>=<value>value</value> ...]</syntax>
73 <default/>
74 <context>location</context>
75
76 <para>
77 Defines the XSLT stylesheet and its optional parameters.
78 A stylesheet is compiled during the configuration stage.
79 </para>
80
81 <para>
82 Parameters can either be specified separately, or grouped in a
83 single line using the “<literal>:</literal>” delimiter.
84 If a parameter includes the “<literal>:</literal>” character,
85 it should be escaped as “<literal>%3A</literal>”.
86 Also, <command>libxslt</command> requires to enclose parameters
87 that contain non-alphanumeric characters into single or double quotes,
88 for example:
89 <example>
90 param1='http%3A//www.example.com':param2=value2
91 </example>
92 </para>
93
94 <para>
95 The description of parameters can contain variables, for example,
96 the whole line of parameters can be taken from a single variable:
97 <example>
98 location / {
99 xslt_stylesheet /site/xslt/one.xslt
100 $arg_xslt_params
101 param1='$value1':param2=value2
102 param3=value3;
103 }
104 </example>
105 </para>
106
107 <para>
108 It is possible to specify several stylesheets; in this case they
109 will be applied sequentially in the specified order.
110 </para>
111
112 </directive>
113
114
115 <directive name="xslt_types">
116 <syntax><value>mime-type</value> ...</syntax>
117 <default>text/xml</default>
118 <context>http</context>
119 <context>server</context>
120 <context>location</context>
121
122 <para>
123 Enables transformations in responses with the specified MIME types
124 in addition to “<literal>text/xml</literal>”.
125 If the result of transformation is an HTML response, its MIME type
126 is changes to “<literal>text/html</literal>”.
127 </para>
128
129 </directive>
130
131 </section>
132
133 </module>