happstack-server-6.2.5: Web related tools and services.

Happstack.Server.XSLT

Description

Functions to allow you to use XSLT to transform your output. To use this, you would generally design your happstack application to output XML. The xslt filter will then run an external tool which performs the tranforms. The transformed result will then be sent to the http client as the Response.

NOTE: This module is currently looking for a maintainer. If you want to improve XSLT support in Happstack, please volunteer!

Synopsis

Documentation

xsltFile :: XSLPath -> FilePath -> FilePath -> IO ()

Note that the xsl file must have .xsl suffix.

xsltString :: XSLPath -> String -> String

Uses the provided xsl file to transform the given string. This function creates temporary files during its execution, but guarantees their cleanup.

xsltFPS :: XSLPath -> [ByteString] -> [ByteString]

Performs an XSL transformation with lists of ByteStrings instead of a String.

xsltFPSIO :: XSLPath -> [ByteString] -> IO [ByteString]

Equivalent to xsltFPS but does not hide the inherent IO of the low-level ByteString operations.

xslt

Arguments

:: (MonadIO m, MonadPlus m, ToMessage r) 
=> XSLTCmd

XSLT preprocessor. Usually xsltproc or saxon.

-> XSLPath

Path to xslt stylesheet.

-> m r

Affected ServerParts.

-> m Response 

Use cmd to transform XML against xslPath. This function only acts if the content-type is application/xml.

doXslt :: MonadIO m => XSLTCmd -> XSLPath -> Response -> m Response

xsltproc :: XSLTCmd

Use xsltproc to transform XML.

saxon :: XSLTCmd

Use saxon to transform XML.