xml-conduit-0.7.0.1: Pure-Haskell utilities for dealing with XML with the conduit package.

Safe HaskellSafe-Infered

Text.XML.Stream.Render

Description

Enumeratees to render XML Events. Unlike libxml-enumerator and expat-enumerator, this module does not provide IO and ST variants, since the underlying rendering operations are pure functions.

Synopsis

Documentation

renderBuilder :: Monad m => RenderSettings -> Conduit Event m BuilderSource

Render a stream of Events into a stream of Builders. Builders are from the blaze-builder package, and allow the create of optimally sized ByteStrings with minimal buffer copying.

renderBytes :: MonadUnsafeIO m => RenderSettings -> Conduit Event m ByteStringSource

Render a stream of Events into a stream of ByteStrings. This function wraps around renderBuilder and builderToByteString, so it produces optimally sized ByteStrings with minimal buffer copying.

The output is UTF8 encoded.

renderText :: (MonadThrow m, MonadUnsafeIO m) => RenderSettings -> Conduit Event m TextSource

Render a stream of Events into a stream of ByteStrings. This function wraps around renderBuilder, builderToByteString and renderBytes, so it produces optimally sized ByteStrings with minimal buffer copying.

def :: Default a => a

The default value for this type.

prettify :: Monad m => Conduit Event m EventSource

Convert a stream of Events into a prettified one, adding extra whitespace. Note that this can change the meaning of your XML.