-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A fast event-based XML parser in pure Haskell
--   
--   A fast, low-memory use, event-based XML parser in pure Haskell.
@package xeno
@version 0.3.4


-- | Shared types.
module Xeno.Types
data XenoException
XenoStringIndexProblem :: XenoException
XenoParseError :: ByteString -> XenoException
XenoExpectRootNode :: XenoException
instance GHC.Generics.Generic Xeno.Types.XenoException
instance Control.DeepSeq.NFData Xeno.Types.XenoException
instance GHC.Show.Show Xeno.Types.XenoException
instance GHC.Exception.Exception Xeno.Types.XenoException


-- | SAX parser and API for XML.
module Xeno.SAX

-- | Process events with callbacks in the XML input.
process :: Monad m => (ByteString -> m ()) -> (ByteString -> ByteString -> m ()) -> (ByteString -> m ()) -> (ByteString -> m ()) -> (ByteString -> m ()) -> (ByteString -> m ()) -> ByteString -> m ()

-- | Fold over the XML input.
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

-- | 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)
--   
--   <pre>
--   &gt; :set -XOverloadedStrings
--   &gt; validate "&lt;b&gt;"
--   True
--   </pre>
--   
--   <pre>
--   &gt; validate "&lt;b"
--   False
--   </pre>
validate :: ByteString -> Bool

-- | Parse the XML and pretty print it to stdout.
dump :: ByteString -> IO ()


-- | DOM parser and API for XML.
module Xeno.DOM

-- | Parse a complete Nodes document.
parse :: ByteString -> Either XenoException Node

-- | Some XML nodes.
data Node

-- | Content of a node.
data Content
Element :: {-# UNPACK #-} !Node -> Content
Text :: {-# UNPACK #-} !ByteString -> Content
CData :: {-# UNPACK #-} !ByteString -> Content

-- | Name of the element.
name :: Node -> ByteString

-- | Attributes of a node.
attributes :: Node -> [(ByteString, ByteString)]

-- | Contents of a node.
contents :: Node -> [Content]

-- | Get just element children of the node (no text).
children :: Node -> [Node]
instance GHC.Show.Show Xeno.DOM.Content
instance GHC.Classes.Eq Xeno.DOM.Content
instance GHC.Classes.Eq Xeno.DOM.Node
instance Control.DeepSeq.NFData Xeno.DOM.Node
instance GHC.Show.Show Xeno.DOM.Node
