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!
- xsltFile :: XSLPath -> FilePath -> FilePath -> IO ()
- xsltString :: XSLPath -> String -> String
- xsltFPS :: XSLPath -> [ByteString] -> [ByteString]
- xsltFPSIO :: XSLPath -> [ByteString] -> IO [ByteString]
- type XSLPath = FilePath
- xslt :: (MonadIO m, MonadPlus m, ToMessage r) => XSLTCmd -> XSLPath -> m r -> m Response
- doXslt :: MonadIO m => XSLTCmd -> XSLPath -> Response -> m Response
- xsltproc :: XSLTCmd
- saxon :: XSLTCmd
- procFPSIO :: XSLTCommand -> XSLPath -> [ByteString] -> IO [ByteString]
- procLBSIO :: XSLTCmd -> XSLPath -> ByteString -> IO ByteString
- type XSLTCommand = XSLPath -> FilePath -> FilePath -> (FilePath, [String])
- data XSLTCmd
Documentation
xsltFile :: XSLPath -> FilePath -> FilePath -> IO ()Source
Note that the xsl file must have .xsl suffix.
xsltString :: XSLPath -> String -> StringSource
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]Source
Performs an XSL transformation with lists of ByteStrings instead of a String.
xsltFPSIO :: XSLPath -> [ByteString] -> IO [ByteString]Source
Equivalent to xsltFPS
but does not hide the inherent IO of the low-level
ByteString operations.
:: (MonadIO m, MonadPlus m, ToMessage r) | |
=> XSLTCmd | |
-> XSLPath | Path to xslt stylesheet. |
-> m r | Affected |
-> m Response |
Use cmd
to transform XML against xslPath
. This function only
acts if the content-type is application/xml
.
procFPSIO :: XSLTCommand -> XSLPath -> [ByteString] -> IO [ByteString]Source
procLBSIO :: XSLTCmd -> XSLPath -> ByteString -> IO ByteStringSource