Safe Haskell | Safe-Infered |
---|
Text.XML.Stream.Render
Description
Enumeratee
s to render XML Event
s. Unlike libxml-enumerator and
expat-enumerator, this module does not provide IO and ST variants, since the
underlying rendering operations are pure functions.
- renderBuilder :: Monad m => RenderSettings -> Pipe l Event Builder r m r
- renderBytes :: MonadUnsafeIO m => RenderSettings -> Pipe l Event ByteString r m r
- renderText :: (MonadThrow m, MonadUnsafeIO m) => RenderSettings -> Pipe l Event Text r m r
- data RenderSettings
- def :: Default a => a
- rsPretty :: RenderSettings -> Bool
- rsNamespaces :: RenderSettings -> [(Text, Text)]
- rsAttrOrder :: RenderSettings -> Name -> Map Name Text -> [(Name, Text)]
- prettify :: Monad m => Pipe l Event Event r m r
Documentation
renderBuilder :: Monad m => RenderSettings -> Pipe l Event Builder r m rSource
Render a stream of Event
s into a stream of Builder
s. Builders are from
the blaze-builder package, and allow the create of optimally sized
ByteString
s with minimal buffer copying.
renderBytes :: MonadUnsafeIO m => RenderSettings -> Pipe l Event ByteString r m rSource
Render a stream of Event
s into a stream of ByteString
s. This function
wraps around renderBuilder
and builderToByteString
, so it produces
optimally sized ByteString
s with minimal buffer copying.
The output is UTF8 encoded.
renderText :: (MonadThrow m, MonadUnsafeIO m) => RenderSettings -> Pipe l Event Text r m rSource
Render a stream of Event
s into a stream of ByteString
s. This function
wraps around renderBuilder
, builderToByteString
and renderBytes
, so it
produces optimally sized ByteString
s with minimal buffer copying.
data RenderSettings Source
Instances
rsPretty :: RenderSettings -> BoolSource
rsNamespaces :: RenderSettings -> [(Text, Text)]Source
Defines some top level namespace definitions to be used, in the form of (prefix, namespace). This has absolutely no impact on the meaning of your documents, but can increase readability by moving commonly used namespace declarations to the top level.
rsAttrOrder :: RenderSettings -> Name -> Map Name Text -> [(Name, Text)]Source
Specify how to turn the unordered attributes used by the Text.XML module into an ordered list.