-- | Use @cmd@ to transform XML against @xslPath@.  This function only
-- acts if the content-type is @application\/xml@.
xslt :: (MonadIO m, MonadPlus m, ToMessage r) =>
        XSLTCmd  -- ^ XSLT preprocessor. Usually 'xsltproc' or 'saxon'.
     -> XSLPath      -- ^ Path to xslt stylesheet.
     -> m r -- ^ Affected 'ServerPart's.
     -> m Response
xslt cmd xslPath parts = do
    res <- parts
    if toContentType res == B.pack "application/xml"
        then doXslt cmd xslPath (toResponse res)
        else return (toResponse res)
xslt :: (MonadIO m, MonadPlus m, ToMessage r) =>
        XSLTCmd  -- ^ XSLT preprocessor. Usually 'xsltproc' or 'saxon'.
     -> XSLPath      -- ^ Path to xslt stylesheet.
     -> m r -- ^ Affected 'ServerPart's.
     -> m Response
xslt cmd xslPath parts = do
    res <- parts
    if toContentType res == B.pack "application/xml"
        then doXslt cmd xslPath (toResponse res)
        else return (toResponse res)
xslt cmd xslPath parts = do
    res <- parts
    if toContentType res == B.pack "application/xml"
        then doXslt cmd xslPath (toResponse res)
        else return (toResponse res)