Mercurial > hg > nginx-site
changeset 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 | a837069db70d |
children | 9cb58efe09e8 |
files | xml/en/GNUmakefile xml/en/docs/http/ngx_http_xslt_module.xml xml/en/docs/index.xml xml/en/index.xml |
diffstat | 4 files changed, 142 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/GNUmakefile Mon Jan 30 12:11:17 2012 +0000 +++ b/xml/en/GNUmakefile Mon Jan 30 12:11:46 2012 +0000 @@ -76,6 +76,7 @@ http/ngx_http_sub_module \ http/ngx_http_upstream_module \ http/ngx_http_userid_module \ + http/ngx_http_xslt_module \ REFS_XML = $(foreach name, $(REFS), xml/$(DOC_LANG)/docs/$(name).xml) REFS_HTML = $(foreach name, $(REFS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/en/docs/http/ngx_http_xslt_module.xml Mon Jan 30 12:11:46 2012 +0000 @@ -0,0 +1,133 @@ +<?xml version="1.0"?> + +<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> + +<module name="Module ngx_http_xslt_module" + link="/en/docs/http/ngx_http_xslt_module.html" + lang="en"> + +<section id="summary"> + +<para> +The <literal>ngx_http_xslt_module</literal> (0.7.8+) is a filter +that transforms XML responses using one or more XSLT stylesheets. +</para> + +<para> +This module is not built by default, it should be enabled with the +<literal>--with-http_xslt_module</literal> +configuration parameter. +<note> +This module requires the +<link url="http://www.xmlsoft.org">libxml2 and libxslt</link> libraries. +</note> +</para> + +</section> + + +<section id="example" name="Example Configuration"> + +<para> +<example> +location / { + xml_entities /site/dtd/entities.dtd; + xslt_stylesheet /site/xslt/one.xslt param=value; + xslt_stylesheet /site/xslt/two.xslt; +} +</example> +</para> + +</section> + + +<section id="directives" name="Directives"> + +<directive name="xml_entities"> +<syntax><value>path</value></syntax> +<default/> +<context>http</context> +<context>server</context> +<context>location</context> + +<para> +Specifies the DTD file that declares character entities. +This file is compiled during the configuration stage. +For technical reasons the module is unable to use the +external subset declared in the processed XML, so it is +ignored and instead a specially defined file is used. +This file should not describe the XML structure, it is +enough to only declare the required character entities, for example: +<example> +<!ENTITY nbsp "&#xa0;"> +</example> +</para> + +</directive> + + +<directive name="xslt_stylesheet"> +<syntax> + <value>stylesheet</value> + [<value>parameter</value>=<value>value</value> ...]</syntax> +<default/> +<context>location</context> + +<para> +Defines the XSLT stylesheet and its optional parameters. +A stylesheet is compiled during the configuration stage. +</para> + +<para> +Parameters can either be specified separately, or grouped in a +single line using the “<literal>:</literal>” delimiter. +If a parameter includes the “<literal>:</literal>” character, +it should be escaped as “<literal>%3A</literal>”. +Also, <command>libxslt</command> requires to enclose parameters +that contain non-alphanumeric characters into single or double quotes, +for example: +<example> +param1='http%3A//www.example.com':param2=value2 +</example> +</para> + +<para> +The description of parameters can contain variables, for example, +the whole line of parameters can be taken from a single variable: +<example> +location / { + xslt_stylesheet /site/xslt/one.xslt + $arg_xslt_params + param1='$value1':param2=value2 + param3=value3; +} +</example> +</para> + +<para> +It is possible to specify several stylesheets; in this case they +will be applied sequentially in the specified order. +</para> + +</directive> + + +<directive name="xslt_types"> +<syntax><value>mime-type</value> ...</syntax> +<default>text/xml</default> +<context>http</context> +<context>server</context> +<context>location</context> + +<para> +Enables transformations in responses with the specified MIME types +in addition to “<literal>text/xml</literal>”. +If the result of transformation is an HTML response, its MIME type +is changes to “<literal>text/html</literal>”. +</para> + +</directive> + +</section> + +</module>
--- a/xml/en/docs/index.xml Mon Jan 30 12:11:17 2012 +0000 +++ b/xml/en/docs/index.xml Mon Jan 30 12:11:46 2012 +0000 @@ -229,6 +229,11 @@ ngx_http_userid_module</link> </item> +<item> +<link doc="http/ngx_http_xslt_module.xml"> +ngx_http_xslt_module</link> +</item> + </list> </para>
--- a/xml/en/index.xml Mon Jan 30 12:11:17 2012 +0000 +++ b/xml/en/index.xml Mon Jan 30 12:11:46 2012 +0000 @@ -67,7 +67,9 @@ Modular architecture. Filters include <link doc="docs/http/ngx_http_gzip_module.xml">gzipping</link>, -byte ranges, chunked responses, XSLT, SSI, +byte ranges, chunked responses, +<link doc="docs/http/ngx_http_xslt_module.xml">XSLT</link>, +SSI, and <link doc="docs/http/ngx_http_image_filter_module.xml">image transformation</link> filter. Multiple SSI inclusions within a single page can be processed in