Last active
August 29, 2015 14:06
-
-
Save danchoi/d9b48976d16876017c28 to your computer and use it in GitHub Desktop.
HaXml SAX example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[(N "AnalystId",264201849),(N "PersonID",22744894),(N "FirstName",Brian),(N "LastName",Purdy),(N "MiddleName",G.),(N "CurrentProFlag",true),(N "HasResearchFlag",true),(N "ContributorShortName",PI Financial Corp.),(N "EmailAddress",[email protected]),(N "PhoneNumber",403-543-2823),(N "Prefix",Mr.),(N "ResearchContributorId",928),(N "Suffix",CFA, P.E.),(N "Title",Energy Services Analyst)] | |
[(N "AnalystId",52747961),(N "PersonID",52747958),(N "FirstName",Mark),(N "LastName",Purdy),(N "CurrentProFlag",false),(N "HasResearchFlag",true),(N "ContributorShortName",Deutsche Bank),(N "Prefix",Mr.),(N "ResearchContributorId",5),(N "Title",Equity Analyst)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Text.XML.HaXml.SAX | |
proc (SaxElementOpen "ResearchAnalystInfo" xs) = do | |
print xs | |
proc _ = return () | |
main = do | |
c <- getContents | |
let (elems, _) = saxParse "analyst_y.xml" c | |
mapM_ proc elems |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment