module LWN.XHTML ( XHTML, XML, my_read_opts, parse_lwn, to_xhtml, to_xml ) where import Text.XML.HXT.Core ( ArrowXml, IOStateArrow, SysConfigList, XmlTree, no, readString, withParseHTML, withValidate, withWarnings, yes ) class XHTML a where to_xhtml :: a -> String class XML a where to_xml :: (ArrowXml b) => a -> (b XmlTree XmlTree) -- | Options used when parsing HTML. my_read_opts :: SysConfigList my_read_opts = [ withValidate no, withParseHTML yes, withWarnings no ] -- | My version of HandsomeSoup's parseHTML. parse_lwn :: String -> IOStateArrow s b XmlTree parse_lwn = readString my_read_opts