xml-conduit-1.0.1.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 -> Pipe l Event Builder r m rSource

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 -> Pipe l Event ByteString r m rSource

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 -> Pipe l Event Text r m rSource

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.

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.

prettify :: Monad m => Pipe l Event Event r m rSource

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