Welcome! Log In Create A New Profile

Advanced

Re: XSLT Parameter parsing

Maxim Dounin
September 21, 2010 11:26PM
Hello!

[sorry for late reply, I have this flagged in my inbox but had no
time to look at this closely]

On Fri, Jul 30, 2010 at 03:42:12PM +0100, Laurence Rowe wrote:

> XSLT parameter parsing currently allows paramters to be passed one per
> line or multiple per line separated by a colon (:).
> http://wiki.nginx.org/NginxHttpXsltModule#xslt_stylesheet
>
> location / {
> xslt_stylesheet /site/xslt/one.xslt
> $arg_xslt_params
> param1='$value1': param2=value2
> param3=value3;
> }
>
> This has the unfortunate effect of preventing xpath parameters being
> passed as url parameters when they contain a colon (fairly common in
> xpath as a namespace or axis specififer). Consider the following
> configuration:
>
> location / {
> xslt_stylesheet filter.xsl
> xpath=$arg_xpath;
> }
>
> I would like to be able to call call the url
> /doc.xml?xpath=ancestor-or-self::entry, but the current parameter
> parsing code interprets this as multiple invalid parameters
> ``xpath=ancestor-or-self``, ````, ``entry``. As far as I can tell
> there is no way to substitute ":" for "%3A" in a variable.
>
> The attached patch removes support for specifying multiple parameters
> in a single line. You may still supply multiple parameters to an xslt
> by supplying one per line. (I've split the patch into two changesets
> for readability.)

I believe multiple parameters in single argument was initially introduced
to make it possible to pass multiple params as single block. E.g.
via query string argument:

xslt_stylesheet /site/xslt/one.xslt
$arg_xslt_params;

(part of example from
http://sysoev.ru/nginx/docs/http/ngx_http_xslt_module.html#xslt_stylesheet)

I don't think that ripping this functionality just to make writing
xpath arguments easier is a good idea. Correct escaping for ':'
should do the trick.

> As an alternative it may be possible to preserve the current behaviour
> by splitting parameters before the call to ngx_http_complex_value
> which performs the variable substitution, however I was unable to work
> out how to do this myself.

This aproach will prevent the above from working, too.

Maxim Dounin

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

XSLT Parameter parsing Attachments

Laurence Rowe 3582 July 30, 2010 10:44AM

Re: XSLT Parameter parsing

Maxim Dounin 1328 September 21, 2010 11:26PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 318
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready