Skip to content

Instantly share code, notes, and snippets.

@ryoco
Created March 28, 2013 13:39
Show Gist options
  • Save ryoco/5263186 to your computer and use it in GitHub Desktop.
Save ryoco/5263186 to your computer and use it in GitHub Desktop.
import System
importText.XML.HaXml
import Text.XML.HaXml.Posn
import Text.XML.HaXml.Util
import Text.XML.HaXml.Xtract.Parse
main = do
args <- getArgs
contents <- readFile $ head args
let
Document _ _ root _ = xmlParse "" contents
cont = CElem root noPos
m = xtract id "//a[@color='red']" cont !! 0
mapM_ (putStrLn . tagTextContent) $ xtract id "//b" m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment