The Haskell XML Toolbox (hxt) 是一個解析 XML 的庫。html
$ cabal install hxt Installed hxt-9.3.1.16 Prelude> :m +Text.XML.HXT.Parser.XmlParsec Prelude Text.XML.HXT.Parser.XmlParsec>
Prelude Text.XML.HXT.Parser.XmlParsec> xread "<foo>abc<bar/>def</foo>" [NTree (XTag "foo" []) [NTree (XText "abc") [],NTree (XTag "bar" []) [],NTree (XText "def") []]] Prelude Text.XML.HXT.Parser.XmlParsec> :m +Text.XML.HXT.DOM.FormatXmlTree Prelude Text.XML.HXT.Parser.XmlParsec Text.XML.HXT.DOM.FormatXmlTree> putStrLn $ formatXmlTree $ head $ xread "<foo>abc<bar/>def</foo>" ---XTag "foo" | +---XText "abc" | +---XTag "bar" | +---XText "def"
Haskell/XML - Wikibooks
HXT - HaskellWiki
HXT Arrow Lessons
XML Processing with Error checking
Working With Html In Haskellpost