]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/Main.hs
Add TSN.XML.Odds which can (only, for the moment) parse Odds_XML.xml.
[dead/htsn-import.git] / src / Main.hs
index 06cb22e2e46e385ee61a35e7ea89d69cba0c005d..e8c1356b6dd40234046b9f8f44be4188f8f6c4b4 100644 (file)
@@ -46,6 +46,7 @@ import qualified TSN.XML.Heartbeat as Heartbeat ( verify )
 import qualified TSN.XML.Injuries as Injuries ( Listing )
 import qualified TSN.XML.InjuriesDetail as InjuriesDetail ( PlayerListing )
 import qualified TSN.XML.News as News ( Message )
+import qualified TSN.XML.Odds as Odds ( Message )
 import Xml ( DtdName(..), parse_opts )
 
 
@@ -111,8 +112,8 @@ import_file cfg path = do
 
     -- | An arrow which parses the doctype "SYSTEM" of an 'XmlTree'.
     --   We use these to determine the parser to use.
-    doctypeA :: ArrowXml a => a XmlTree DtdName
-    doctypeA = getAttrl >>> hasName "doctype-SYSTEM" /> getText >>^ DtdName
+    dtdnameA :: ArrowXml a => a XmlTree DtdName
+    dtdnameA = getAttrl >>> hasName "doctype-SYSTEM" /> getText >>^ DtdName
 
     -- | Combine the arrows above as well as the function below
     --   (arrowized with 'arr') into an IO action that does everything
@@ -123,7 +124,7 @@ import_file cfg path = do
     --   big one outside of the list.
     parse_and_import :: IO [ImportResult]
     parse_and_import =
-      runX (readA >>> (doctypeA &&& returnA) >>> (arr import_with_dtd))
+      runX (readA >>> (dtdnameA &&& returnA) >>> (arr import_with_dtd))
       >>=
       sequence
 
@@ -154,6 +155,8 @@ import_file cfg path = do
             | dtd == "newsxml.dtd" =
                 dbimport (undefined :: News.Message)
 
+            | dtd == "Odds_XML.dtd" = undefined
+
             | otherwise = \_ -> do -- Dummy arg simplifies the other cases.
               let infomsg =
                     "Unrecognized DTD in " ++ path ++ ": " ++ dtd ++ "."