-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ngx_http_xslt_module.xml的翻译 #36
base: master
Are you sure you want to change the base?
Changes from 2 commits
cae5ecb
1c73c81
a2c8925
302eca4
84b0a7f
92bc710
5cfa5a3
d69b413
2a7db02
ff730af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,23 +10,23 @@ | |
<module name="Module ngx_http_xslt_module" | ||
link="/en/docs/http/ngx_http_xslt_module.html" | ||
lang="en" | ||
translator="allisstone" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 可能你是用tab的,但请对齐 |
||
rev="1"> | ||
|
||
<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. | ||
<literal>ngx_http_xslt_module</literal> (0.7.8+) 是一个filter模块,它使用一个或多个XSLT样式表来转换XML响应。 | ||
</para> | ||
|
||
<para> | ||
This module is not built by default, it should be enabled with the | ||
此模块不是默认编译的,因此它需要指定 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 因此它需要指定 |
||
<literal>--with-http_xslt_module</literal> | ||
configuration parameter. | ||
编译选项。 | ||
<note> | ||
This module requires the | ||
<link url="http://xmlsoft.org">libxml2</link> and | ||
<link url="http://xmlsoft.org/XSLT/">libxslt</link> libraries. | ||
此模块需要 | ||
<link url="http://xmlsoft.org">libxml2</link> 和 | ||
<link url="http://xmlsoft.org/XSLT/">libxslt</link> 库。 | ||
</note> | ||
</para> | ||
|
||
|
@@ -58,13 +58,11 @@ location / { | |
<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: | ||
指定的DTD文件声明字符实体。 | ||
此文件在配置阶段编译。 | ||
由于技术原因,模块不能使用在处理XML阶段声明的外部子集,而是采用了一个专门定义文件。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 模块不能使用在处理XML阶段声明的外部子集,而是采用了一个专门定义文件。 |
||
这个文件不能描述XML结构,它仅能描述需要的字符实体,比如: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个文件仅能描述需要的字符实体,而不应该使用它来描述XML结构,比如: |
||
|
||
<example> | ||
<!ENTITY nbsp "&#xa0;"> | ||
</example> | ||
|
@@ -82,19 +80,17 @@ enough to only declare the required character entities, for example: | |
<appeared-in>1.1.18</appeared-in> | ||
|
||
<para> | ||
Defines parameters for XSLT stylesheets. | ||
The <value>value</value> is treated as an XPath expression. | ||
The <value>value</value> can contain variables. | ||
To pass a string value to a stylesheet, | ||
the <link id="xslt_string_param"/> directive can be used. | ||
定义一个XSLT样式表参数。 | ||
<value>value</value> 值被视为一个XPath表达式。 | ||
<value>value</value> 值可以包含变量。 | ||
可以使用指令<link id="xslt_string_param"/> 来传递一个字符串值给样式表。 | ||
</para> | ||
|
||
<para> | ||
There could be several <literal>xslt_param</literal> directives. | ||
These directives are inherited from the previous level if and | ||
only if there are no | ||
<literal>xslt_param</literal> and <link id="xslt_string_param"/> | ||
directives defined on the current level. | ||
可能会有几个 <literal>xslt_param</literal> 指令。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 可能会有 |
||
当且仅当没有定义在当前level的指令 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<literal>xslt_param</literal> 和 <link id="xslt_string_param"/> | ||
,这些指令才能继承之前的level。 | ||
</para> | ||
|
||
</directive> | ||
|
@@ -109,17 +105,16 @@ directives defined on the current level. | |
<appeared-in>1.1.18</appeared-in> | ||
|
||
<para> | ||
Defines string parameters for XSLT stylesheets. | ||
XPath expressions in the <value>value</value> are not interpreted. | ||
The <value>value</value> can contain variables. | ||
为XSLT样式表定义一个字符串参数。 | ||
包含XPath 表达式的 <value>value</value> 值不做阐述。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nginx不解析value中包含的XPath表达式 |
||
<value>value</value> 值可以包含变量。 | ||
</para> | ||
|
||
<para> | ||
There could be several <literal>xslt_string_param</literal> directives. | ||
These directives are inherited from the previous level if and | ||
only if there are no | ||
<link id="xslt_param"/> and <literal>xslt_string_param</literal> | ||
directives defined on the current level. | ||
可能会有一些<literal>xslt_string_param</literal> 指令。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 建议同上 |
||
当且仅当没有定义在当前level的指令 | ||
<link id="xslt_param"/> 和 <literal>xslt_string_param</literal> | ||
,这些指令才能继承之前的level。 | ||
</para> | ||
|
||
</directive> | ||
|
@@ -133,26 +128,24 @@ directives defined on the current level. | |
<context>location</context> | ||
|
||
<para> | ||
Defines the XSLT stylesheet and its optional parameters. | ||
A stylesheet is compiled during the configuration stage. | ||
定义一个XSLT样式表和它的可选参数。 | ||
样式表在配置阶段编译。 | ||
</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: | ||
参数既可以单独指定,也可以在一行中使用分隔符 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
“<literal>:</literal>” 来分组。 | ||
如果一个参数包含了“<literal>:</literal>” 字符, | ||
它应该被转义为 “<literal>%3A</literal>”。 | ||
并且<command>libxslt</command> | ||
需要封装成参数,这个参数包含转换为单引号或者双引号的非字母字符。例如: | ||
<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: | ||
参数的描述可以包含变量,例如,整条线的参数可以取自一个单一变量: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 可以使用变量描述参数(不限参数名和参数值),例如,整行参数都由一个变量指定。 |
||
<example> | ||
location / { | ||
xslt_stylesheet /site/xslt/one.xslt | ||
|
@@ -164,8 +157,7 @@ location / { | |
</para> | ||
|
||
<para> | ||
It is possible to specify several stylesheets; in this case they | ||
will be applied sequentially in the specified order. | ||
可以指定几个样式表,它们可以按照指定的顺序来排序应用。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 可以指定多个样式表;在这种情况下,他们将按配置中指定的顺序生效。 |
||
</para> | ||
|
||
</directive> | ||
|
@@ -179,11 +171,9 @@ will be applied sequentially in the specified order. | |
<context>location</context> | ||
|
||
<para> | ||
Enables transformations in responses with the specified MIME types | ||
in addition to “<literal>text/xml</literal>”. | ||
The special value “<literal>*</literal>” matches any MIME type (0.8.29). | ||
If the result of transformation is an HTML response, its MIME type | ||
is changes to “<literal>text/html</literal>”. | ||
除了“<literal>text/xml</literal>”类型,启用指定的MIME类型的转换相应。 | ||
特别指定的值“<literal>*</literal>”匹配任何MIME类型(0.8.29)。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 特别指定的值 |
||
如果转换的结果是HTML相应,它的MIME类型就变为“<literal>text/html</literal>”. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 对指定的响应Mime类型启用转换,text/xml默认会被转换 如果转换的结果是HTML相应 如果转换的结果是HTML响应 |
||
</para> | ||
|
||
</directive> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en
cn