-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Parsing XML with Parsec -- -- Helper functions to use a Parsec-based parser for XML documents. This -- was originally developed as part of the Barracuda ad-hoc P2P chat -- client. -- -- The Darcs repository can be found at -- http://darcs.mroot.net/sep07-adhoc/ @package xml-parsec @version 1.0.3 -- | Helper functions to use a Parsec-Parser for XML documents. module Text.ParserCombinators.Parsec.XML -- | A Parser for XML Content. type XMLParser a = GenParser (Content Posn) () a -- | Accepts any content. anyContent :: XMLParser (Content Posn) -- | Accepts content verified by a function. content :: (Content Posn -> Maybe a) -> XMLParser a -- | Forces an Element as next token. element :: XMLParser (Element Posn) -- | Forces plain text as next token. text :: XMLParser String -- | As namedElementWithAttrs, ony that the attributes are ignored. namedElement :: String -> XMLParser [Content Posn] -- | Parses an element with given name. Returns the xml Attributes. namedElementWithAttrs :: String -> XMLParser ([Attribute], [Content Posn]) -- | Parses an element with a given name. The text content is returned. stringElement :: String -> XMLParser String -- | Helper function to recurse through an XML document. recurse :: XMLParser a -> [Content Posn] -> XMLParser a -- | Helper function to recurse through an XML document. recurseElements :: XMLParser a -> [Content Posn] -> XMLParser a