Opened 10 years ago

Last modified 8 years ago

#609 new enhancement

Apply xslt-html-parser patch to http_xslt_module (used by Diazo)

Reported by: Christopher Mann Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.6.x
Keywords: http_xslt_module, xslt-html-parser Cc: christopher@…
uname -a: Linux web303.webfaction.com 2.6.32-531.17.1.lve1.2.60.el6.x86_64 #1 SMP Tue Jul 8 11:25:32 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.6.1
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
TLS SNI support enabled
configure arguments: --with-http_xslt_module --with-http_stub_status_module --add-module=/home/chris2fr/hacks/nginx_accept_language_module-master --with-ipv6 --with-http_ssl_module --with-cc-opt=-Wno-error --prefix=/home/chris2fr/opt/nginxslt

Description

Hi,

Please integrate the xslt-html-parser patch to the http_xslt_module. This is a feature notably used by Diazo (diazo.org). Here is the patch: https://github.com/jcu-eresearch/nginx-custom-build/blob/master/nginx-xslt-html-parser.patch.

The patch applies to src/http/modules/ngx_http_xslt_filter_module.c. My patch was patch src/http/modules/ngx_http_xslt_filter_module.c nginx-xslt-html-parser.patch.

Here is a blog where I described what I did to get this working:
http://en.wordpress.managence.com/?p=15

I just read the patch, and it seems OK. It adds a htmlFreeParserCtxt if the module is html and not xml. My guess is that would get the parser to XSLT work even if not quite well-formed, but well-enough formed (the goal of the html parse I guess).

Change History (1)

comment:1 by davidjb, 8 years ago

I'm the author of the patch linked above (well, re-authored it and updated it for a modern version of Nginx from https://bitbucket.org/lrowe/nginx-xslt-html-parser originally).

Having this integrated into Nginx core would allow the XSLT filter module to apply to HTML documents, and the patch makes the configuration of XSLT opt-in for compatibility.

I'm yet to experience any issues with the patch (currently with Nginx 1.8.0 and about to test 1.9.x, which the patch seems to still cleanly apply to).

Note: See TracTickets for help on using tickets.