xeno-0.3: A fast event-based XML parser in pure Haskell

Safe HaskellNone
LanguageHaskell2010

Xeno.SAX

Description

SAX parser and API for XML.

Synopsis

Documentation

process Source #

Arguments

:: Monad m 
=> (ByteString -> m ())

Open tag.

-> (ByteString -> ByteString -> m ())

Tag attribute.

-> (ByteString -> m ())

End open tag.

-> (ByteString -> m ())

Text.

-> (ByteString -> m ())

Close tag.

-> (ByteString -> m ())

CDATA.

-> ByteString 
-> m () 

Process events with callbacks in the XML input.

fold Source #

Arguments

:: (s -> ByteString -> s)

Open tag.

-> (s -> ByteString -> ByteString -> s)

Attribute key/value.

-> (s -> ByteString -> s)

End of open tag.

-> (s -> ByteString -> s)

Text.

-> (s -> ByteString -> s)

Close tag.

-> (s -> ByteString -> s)

CDATA.

-> s 
-> ByteString 
-> Either XenoException s 

Fold over the XML input.

validate :: ByteString -> Bool Source #

Parse the XML but return no result, process no events.

dump :: ByteString -> IO () Source #

Parse the XML and pretty print it to stdout.