procFPSIO :: XSLTCommand
             -> XSLPath
             -> [P.ByteString]
             -> IO [P.ByteString]
procFPSIO xsltp xsl inp = 
    withTempFile "happs-src.xml" $ \sfp sh -> do
    withTempFile "happs-dst.xml" $ \dfp dh -> do
    mapM_ (P.hPut sh) inp
    hClose sh
    hClose dh
    xsltFileEx xsltp xsl sfp dfp
    s <- P.readFile dfp
    logMX DEBUG (">>> XSLT: result: "++ show s)
    return [s]

-- | Performs an XSL transformation with lists of ByteStrings instead of
-- a String.
procFPSIO :: XSLTCommand
             -> XSLPath
             -> [P.ByteString]
             -> IO [P.ByteString]
procFPSIO xsltp xsl inp = 
    withTempFile "happs-src.xml" $ \sfp sh -> do
    withTempFile "happs-dst.xml" $ \dfp dh -> do
    mapM_ (P.hPut sh) inp
    hClose sh
    hClose dh
    xsltFileEx xsltp xsl sfp dfp
    s <- P.readFile dfp
    logMX DEBUG (">>> XSLT: result: "++ show s)
    return [s]

-- | Performs an XSL transformation with lists of ByteStrings instead of
-- a String.
procFPSIO xsltp xsl inp = 
    withTempFile "happs-src.xml" $ \sfp sh -> do
    withTempFile "happs-dst.xml" $ \dfp dh -> do
    mapM_ (P.hPut sh) inp
    hClose sh
    hClose dh
    xsltFileEx xsltp xsl sfp dfp
    s <- P.readFile dfp
    logMX DEBUG (">>> XSLT: result: "++ show s)
    return [s]

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