XSLT Parameter parsing

Laurence Rowe l at lrowe.co.uk
Fri Jul 30 18:42:12 MSD 2010


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.)

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.

Laurence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: params.diff
Type: application/octet-stream
Size: 4293 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-devel/attachments/20100730/755b3a3a/attachment.obj>


More information about the nginx-devel mailing list