xslt_string_param

The `xslt_string_param` directive allows you to define parameters for XSLT processing in NGINX configurations.

Syntaxxslt_string_param parameter_name value;
Defaultnone
Contexthttp, server, location
Arguments2

Description

The xslt_string_param directive is utilized within the NGINX configuration to pass string parameters to the XSLT processor. This directive is applicable in the contexts of http, server, and location. It accepts two parameters: the name of the parameter and its value. The parameters are used in the transformation process when XSLT is applied to XML data served by NGINX. The directive's role is crucial when dynamic data needs to be passed to XSLT stylesheets for generating customized outputs based on incoming requests.

For instance, if you have an XSLT stylesheet that requires a user-specific name to render personalized content, you would use this directive to specify the name parameter with the appropriate value in your NGINX configuration. The ability to provide multiple such parameters allows you to pass various data points into your transformation process, enhancing the dynamic capabilities of your content delivery through XSLT. When using xslt_string_param, care must be taken to properly match the parameter names expected by the XSLT, ensuring seamless integration and expected output.

Config Example

location /transform {
    xslt_stylesheet /path/to/stylesheet.xsl;
    xslt_string_param user_name "John Doe";
    xslt_string_param display_message "Welcome to our website!";
}

Ensure that the parameter names match those expected in the XSLT stylesheet to avoid processing errors.

Using non-string values may lead to unexpected behavior in the XSLT transformation.

Define parameters only in contexts where the XSLT processing is applicable to avoid configuration warnings.

← Back to all directives