libxml-sax-0.4: Bindings for the libXML2 SAX interfaceSource codeContentsIndex
Text.XML.LibXML.SAX
Synopsis
data Parser
data Event
= BeginElement Name [Attribute]
| EndElement Name
| Characters Text
| Comment Text
| ProcessingInstruction Instruction
data Error = Error Text
newParser :: IO Parser
parse :: Parser -> ByteString -> Bool -> IO (FailableList Error Event)
eventsToElement :: [Event] -> Maybe Element
Documentation
data Parser Source
An opaque reference to a libXML SAX parser.
data Event Source
Constructors
BeginElement Name [Attribute]
EndElement Name
Characters Text
Comment Text
ProcessingInstruction Instruction
show/hide Instances
data Error Source
Constructors
Error Text
show/hide Instances
newParser :: IO ParserSource
Construct a new, empty parser.
parse :: Parser -> ByteString -> Bool -> IO (FailableList Error Event)Source

Feed some text into the parser. This may be performed multiple times per Parser value, in which case the internal parser state is retained between computations.

If the third parameter is True, the parser assumes that this is the last input and checks that the document was closed correctly.

eventsToElement :: [Event] -> Maybe ElementSource
Convert a list of events to a single Element. If the events do not contain at least one valid element, Nothing will be returned instead.
Produced by Haddock version 2.6.1