Skip to content

Instantly share code, notes, and snippets.

@dino-
Created March 15, 2010 13:06
Show Gist options
  • Save dino-/332808 to your computer and use it in GitHub Desktop.
Save dino-/332808 to your computer and use it in GitHub Desktop.
#! /usr/bin/env runhaskell
import Text.HTML.TagSoup
main :: IO ()
main = do
tags <- fmap parseTags $ readFile "foo.xml";
let names = sections (~== "<name>") $ tags
mapM_ (\t -> putStrLn $ "saw: " ++ t ) $ map fromTagText
$ map (flip (!!) 1) names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment