Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: [PATCH] Return http status code from XSLT

$
0
0
Hello!

On Fri, Mar 08, 2013 at 12:06:48AM +0100, SamB wrote:

> Hi,
>
> this patch provides simple possibility to return http error code
> from within XSLT transformation result.
> This is simple way to quickly and correctly return i.e. 404 error
> codes instead of producing dummy soft-404 pages.
>
> Sample XSLT:
> <xsl:template match="/">
> <html xmlns:http="http://www.w3.org/http" status="400">
> <xsl:copy-of select="."/>
> </html>
> </xsl:template>

While an ability to alter status code returned is intresting, I
don't think it should be done this way, abusing output attributes.
I would rather think of something like an XSLT variable with a
predefined name queried after a transformation.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>