X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FSportInfo.hs;h=9f454d9c473139147e71ac552ca508138832e03c;hb=61a6bbaba5c38efc00b503cb6dec8146242f7177;hp=6bb99a2a484474d8f286e4895bcb3fddc46f4583;hpb=6eb1c7477c2d4d3cace6d1b865a5efbec21300a7;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/SportInfo.hs b/src/TSN/XML/SportInfo.hs index 6bb99a2..9f454d9 100644 --- a/src/TSN/XML/SportInfo.hs +++ b/src/TSN/XML/SportInfo.hs @@ -50,6 +50,7 @@ import TSN.DbImport ( ImportResult(..), run_dbmigrate ) import TSN.Parse ( + ParseError, parse_message, parse_xmlfid, parse_xml_time_stamp ) @@ -161,12 +162,16 @@ dtds = "NCAA_Conference_Schedule_XML.dtd", "nflfirstdownxml.dtd", "NFLFumbleLeaderXML.dtd", + "NFLGrassTurfDomeOutsideXML.dtd", "NFLGiveTakeXML.dtd", "NFLInside20XML.dtd", + "NFLInterceptionLeadersXML.dtd", "NFLKickoffsXML.dtd", "NFLMondayNightXML.dtd", + "NFLPassingLeadersXML.dtd", "NFLPassLeadXML.dtd", "NFLQBStartsXML.dtd", + "NFLReceivingLeadersXML.dtd", "NFLSackLeadersXML.dtd", "nflstandxml.dtd", "NFLTeamRankingsXML.dtd", @@ -208,12 +213,12 @@ data SportInfo = -- | Attempt to parse a 'SportInfo' from an 'XmlTree'. If we cannot, -- we fail with an error message. -- -parse_xml :: String -> XmlTree -> Either String SportInfo +parse_xml :: String -> XmlTree -> Either ParseError SportInfo parse_xml dtdname xmltree = do xmlfid <- parse_xmlfid xmltree timestamp <- parse_xml_time_stamp xmltree message <- parse_message xmltree - return $ SportInfo dtdname (fromInteger xmlfid) timestamp (xshow [message]) + return $ SportInfo dtdname xmlfid timestamp (xshow [message]) --