-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Bindings for the libXML2 SAX interface
--
-- Bindings for the libXML2 SAX interface
@package libxml-sax
@version 0.7.6
-- | Bindings for the libXML2 SAX interface
module Text.XML.LibXML.SAX
-- | A Parser tracks the internal state of a LibXML parser context.
--
-- As LibXML is a very stateful library, parsers must operate within
-- either the IO or ST monad. Use newParserIO or
-- newParserST to create parsers in the appropriate monad.
--
-- In general, clients should prefer newParserST, because ST
-- values can be safely computed with no side effects.
data Parser m
newParserIO :: Maybe Text -> IO (Parser IO)
newParserST :: Maybe Text -> ST s (Parser (ST s))
parseBytes :: Parser m -> ByteString -> m ()
-- | Finish parsing any buffered data, and check that the document was
-- closed correctly.
parseComplete :: Parser m -> m ()
data Callback m a
-- | Set a callback computation to run when a particular parse event
-- occurs. The callback should return True to continue parsing, or
-- False to abort.
--
-- Alternatively, callbacks may throw an Exception to abort
-- parsing. The exception will be propagated through to the caller of
-- parseBytes or parseComplete.
setCallback :: Parser m -> Callback m a -> a -> m ()
-- | Remove a callback from the parser. This might also change the parser's
-- behavior, such as automatically expanding entity references when no
-- parsedReference callback is set.
clearCallback :: Parser m -> Callback m a -> m ()
parsedBeginDocument :: Callback m (m Bool)
parsedEndDocument :: Callback m (m Bool)
parsedBeginElement :: Callback m (Name -> [(Name, [Content])] -> m Bool)
parsedEndElement :: Callback m (Name -> m Bool)
parsedCharacters :: Callback m (Text -> m Bool)
-- | If parsedReference is set, entity references in element and
-- attribute content will reported separately from text, and will not be
-- automatically expanded.
--
-- Use this when processing documents in passthrough mode, to preserve
-- existing entity references.
parsedReference :: Callback m (Text -> m Bool)
parsedComment :: Callback m (Text -> m Bool)
parsedInstruction :: Callback m (Instruction -> m Bool)
-- | If parsedCDATA is set, it receives any text contained in CDATA
-- blocks. By default, all text is received by parsedCharacters.
parsedCDATA :: Callback m (Text -> m Bool)
-- | If parsedWhitespace is set, it receives any whitespace marked
-- as ignorable by the document's DTD. By default, all text is received
-- by parsedCharacters.
parsedWhitespace :: Callback m (Text -> m Bool)
parsedInternalSubset :: Callback m (Text -> Maybe ExternalID -> m Bool)
parsedExternalSubset :: Callback m (Text -> Maybe ExternalID -> m Bool)
reportWarning :: Callback m (Text -> m Bool)
reportError :: Callback m (Text -> m Bool)