{-
-- | Uses 'xsltString' to transform the given XML 'Element' into a
-- a 'String'.    
xsltElem :: XSLPath -> Element -> String
xsltElem xsl = xsltString xsl . verbatim
-}

procLBSIO :: XSLTCmd -> XSLPath -> L.ByteString -> IO L.ByteString
procLBSIO xsltp' xsl inp = 
    withTempFile "happs-src.xml" $ \sfp sh -> do
    withTempFile "happs-dst.xml" $ \dfp dh -> do
    let xsltp = xsltCmd xsltp'
    L.hPut sh inp
    hClose sh
    hClose dh
    xsltFileEx xsltp xsl sfp dfp
    s <- L.readFile dfp
    logMX DEBUG (">>> XSLT: result: "++ show s)
    return s
procLBSIO :: XSLTCmd -> XSLPath -> L.ByteString -> IO L.ByteString
procLBSIO xsltp' xsl inp = 
    withTempFile "happs-src.xml" $ \sfp sh -> do
    withTempFile "happs-dst.xml" $ \dfp dh -> do
    let xsltp = xsltCmd xsltp'
    L.hPut sh inp
    hClose sh
    hClose dh
    xsltFileEx xsltp xsl sfp dfp
    s <- L.readFile dfp
    logMX DEBUG (">>> XSLT: result: "++ show s)
    return s
procLBSIO xsltp' xsl inp = 
    withTempFile "happs-src.xml" $ \sfp sh -> do
    withTempFile "happs-dst.xml" $ \dfp dh -> do
    let xsltp = xsltCmd xsltp'
    L.hPut sh inp
    hClose sh
    hClose dh
    xsltFileEx xsltp xsl sfp dfp
    s <- L.readFile dfp
    logMX DEBUG (">>> XSLT: result: "++ show s)
    return s