packages feed

yuuko-2009.10.23.1: src/Text/HTML/Yuuko.hs

module Text.HTML.Yuuko where

import Text.XML.HXT.Arrow
import qualified Text.XML.HXT.Arrow.XPathSimple as XS

yuuko :: String -> String -> IO [String]
yuuko expr s = do
  runX process

  where
    read_args = 
      [ (a_validate, v_0)
      , (a_parse_html, v_1)
      , (a_encoding, utf8)
      , (a_issue_warnings, v_0)
      ]
    
    write_args = 
      [ (a_encoding, utf8) ]
      
    process =
          readString read_args s
      >>> XS.getXPathTreesInDoc expr
      >>> writeDocumentToString write_args