soap-0.2.3.0: SOAP client tools

Safe HaskellNone
LanguageHaskell98

Network.SOAP.Parsing.Stream

Contents

Description

Collection of helpers to use with Text.XML.Stream.Parse parsers.

let sink = flaxTag "MethodNameResponse"
         $ flaxTag "MethodNameResult" $ do
             info <- flaxTag "Info" $ do
                         q <- readTag "quantity"
                         b <- readTag "balance"
                         return $ Info q b
             rc <- readTag "ResponseCode"
             return (rc, info)

Synopsis

Tags

laxTag :: MonadThrow m => Text -> Sink Event m a -> Sink Event m (Maybe a) Source

Namespace- and attribute- ignorant tagNoAttr.

flaxTag :: MonadThrow m => Text -> Sink Event m a -> Sink Event m a Source

Non-maybe version of laxTag/tagNoAttr.

Content

readContent :: (Read a, MonadThrow m) => Sink Event m a Source

Unpack and read a current tag content.

readTag :: (Read a, MonadThrow m) => Text -> Sink Event m a Source

Unpack and read tag content by local name.

Types to use in custom parser sinks

type Sink i = ConduitM i Void

Consumes a stream of input values and produces a final result, without producing any output.

type Sink i m r = ConduitM i Void m r

Since 0.5.0

data Event :: *

Some XML processing tools are incremental, and work in terms of events rather than node trees. The Event type allows a document to be fully specified as a sequence of events.

Event-based XML libraries include:

Instances

Eq Event 
Data Event 
Ord Event 
Show Event 
Generic Event 
NFData Event 
type Rep Event = D1 D1Event ((:+:) ((:+:) ((:+:) (C1 C1_0Event U1) (C1 C1_1Event U1)) ((:+:) (C1 C1_2Event ((:*:) (S1 NoSelector (Rec0 Text)) (S1 NoSelector (Rec0 (Maybe ExternalID))))) ((:+:) (C1 C1_3Event U1) (C1 C1_4Event (S1 NoSelector (Rec0 Instruction)))))) ((:+:) ((:+:) (C1 C1_5Event ((:*:) (S1 NoSelector (Rec0 Name)) (S1 NoSelector (Rec0 [(Name, [Content])])))) (C1 C1_6Event (S1 NoSelector (Rec0 Name)))) ((:+:) (C1 C1_7Event (S1 NoSelector (Rec0 Content))) ((:+:) (C1 C1_8Event (S1 NoSelector (Rec0 Text))) (C1 C1_9Event (S1 NoSelector (Rec0 Text)))))))