]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/News.hs
Move the XML modules into the XML subdirectory.
[dead/htsn-import.git] / src / TSN / XML / News.hs
similarity index 96%
rename from src/TSN/News.hs
rename to src/TSN/XML/News.hs
index 2366819dcc35418d5be83ea3c165cda5b6af2da6..61da812807e7920a50f089a3767f13beff9200f6 100644 (file)
@@ -11,7 +11,7 @@
 -- | Parse TSN XML for the DTD "newsxml.dtd". Each document contains a
 --   root element \<message\> that contains an entire news item.
 --
-module TSN.News (
+module TSN.XML.News (
   Message,
   news_tests )
 where
@@ -152,16 +152,12 @@ data MessageXml =
 
 data Message =
   Message {
-    db_xml_file_id :: Int,
-    db_heading :: String,
     db_mid :: MsgId,
-    db_category :: String,
     db_sport :: String,
     db_url :: String,
     db_sms :: String,
     db_text :: String,
-    db_continue :: String,
-    db_time_stamp :: String }
+    db_continue :: String }
   deriving (Eq, Show)
 
 instance ToFromXml Message where
@@ -172,10 +168,10 @@ instance ToFromXml Message where
   -- used our named fields.
   to_xml (Message {..}) =
     MessageXml
-      db_xml_file_id
-      db_heading
+      0
+      ""
       db_mid
-      db_category
+      ""
       db_sport
       db_url
       []
@@ -183,12 +179,12 @@ instance ToFromXml Message where
       db_sms
       db_text
       db_continue
-      db_time_stamp
+      ""
 
   -- We don't need the key argument (from_xml_fk) since the XML type
   -- contains more information in this case.
-  from_xml (MessageXml a b c d e f _ _ g h i j) =
-    Message a b c d e f g h i j
+  from_xml (MessageXml _ _ c _ e f _ _ g h i _) =
+    Message c e f g h i
 
 
 mkPersist tsn_codegen_config [groundhog|