Safe Haskell | None |
---|---|
Language | Haskell2010 |
SAX parser and API for XML.
Synopsis
- process :: Monad m => (ByteString -> m ()) -> (ByteString -> ByteString -> m ()) -> (ByteString -> m ()) -> (ByteString -> m ()) -> (ByteString -> m ()) -> (ByteString -> m ()) -> ByteString -> m ()
- fold :: (s -> ByteString -> s) -> (s -> ByteString -> ByteString -> s) -> (s -> ByteString -> s) -> (s -> ByteString -> s) -> (s -> ByteString -> s) -> (s -> ByteString -> s) -> s -> ByteString -> Either XenoException s
- validate :: ByteString -> Bool
- dump :: ByteString -> IO ()
Documentation
:: 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.
:: (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.
N.B.: Only the lexical correctness of the input string is checked, not its XML semantics (e.g. only if tags are well formed, not whether tags are properly closed)
> :set -XOverloadedStrings > validate "<b>" True
> validate "<b" False
dump :: ByteString -> IO () Source #
Parse the XML and pretty print it to stdout.