+ importer
+ | dtd == AutoRacingResults.dtd =
+ go AutoRacingResults.pickle_message
+
+ | dtd == AutoRacingSchedule.dtd =
+ go AutoRacingSchedule.pickle_message
+
+ -- GameInfo and SportInfo appear last in the guards
+ | dtd == Injuries.dtd = go Injuries.pickle_message
+
+ | dtd == InjuriesDetail.dtd = go InjuriesDetail.pickle_message
+
+ | dtd == JFile.dtd = go JFile.pickle_message
+
+ | dtd == News.dtd =
+ -- Some of the newsxml docs are busted in predictable ways.
+ -- We want them to "succeed" so that they're deleted.
+ -- We already know we can't parse them.
+ if News.has_only_single_sms xml
+ then go News.pickle_message
+ else do
+ let msg = "Unsupported newsxml.dtd with multiple SMS " ++
+ "(" ++ path ++ ")"
+ return $ ImportUnsupported msg
+ | dtd == Odds.dtd = go Odds.pickle_message
+
+ | dtd == ScheduleChanges.dtd = go ScheduleChanges.pickle_message
+
+ | dtd == Scores.dtd = go Scores.pickle_message
+
+ -- SportInfo and GameInfo appear last in the guards
+ | dtd == Weather.dtd =
+ -- Some of the weatherxml docs are busted in predictable ways.
+ -- We want them to "succeed" so that they're deleted.
+ -- We already know we can't parse them.
+ if Weather.is_type1 xml
+ then if Weather.teams_are_normal xml
+ then go Weather.pickle_message
+ else do
+ let msg = "Teams in reverse order in weatherxml.dtd" ++
+ " (" ++ path ++ ")"
+ return $ ImportUnsupported msg
+ else do
+ let msg = "Unsupported weatherxml.dtd type (" ++ path ++ ")"
+ return $ ImportUnsupported msg