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

Safe HaskellNone
LanguageHaskell98

Text.XML.Unresolved

Contents

Description

DOM-based XML parsing and rendering.

In this module, attribute values and content nodes can contain either raw text or entities. In most cases, these can be fully resolved at parsing. If that is the case for your documents, the Text.XML module provides simplified datatypes that only contain raw text.

Synopsis

Non-streaming functions

writeFile :: RenderSettings -> FilePath -> Document -> IO () Source

readFile :: ParseSettings -> FilePath -> IO Document Source

Lazy bytestrings

Text

parseText_ :: ParseSettings -> Text -> Document Source

sinkTextDoc :: MonadThrow m => ParseSettings -> Consumer Text m Document Source

Byte streams

sinkDoc :: MonadThrow m => ParseSettings -> Consumer ByteString m Document Source

Streaming functions

toEvents :: Document -> [Event] Source

fromEvents :: MonadThrow m => Consumer EventPos m Document Source

renderBuilder :: Monad m => RenderSettings -> Document -> Producer m Builder Source

renderBytes :: (MonadBase base m, PrimMonad base) => RenderSettings -> Document -> ConduitM a ByteString m () Source

renderText :: (MonadThrow m, MonadBase base m, PrimMonad base) => RenderSettings -> Document -> ConduitM a Text m () Source

Exceptions

Settings

def :: Default a => a

Parse

data ParseSettings Source

Instances

Default ParseSettings 

psRetainNamespaces :: ParseSettings -> Bool Source

Whether the original xmlns attributes should be retained in the parsed values. For more information on motivation, see:

https://github.com/snoyberg/xml/issues/38

Default: False

Since 1.2.1

Render

data RenderSettings Source

Instances

Default RenderSettings 

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.