X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FNews.hs;fp=src%2FTSN%2FNews.hs;h=61da812807e7920a50f089a3767f13beff9200f6;hb=76cf3eee776d35ba2b18dd0d07df7496a083ae3a;hp=2366819dcc35418d5be83ea3c165cda5b6af2da6;hpb=629f04d64544bf942d9ee3283b9f99fa7e5c9d57;p=dead%2Fhtsn-import.git diff --git a/src/TSN/News.hs b/src/TSN/XML/News.hs similarity index 96% rename from src/TSN/News.hs rename to src/TSN/XML/News.hs index 2366819..61da812 100644 --- a/src/TSN/News.hs +++ b/src/TSN/XML/News.hs @@ -11,7 +11,7 @@ -- | Parse TSN XML for the DTD "newsxml.dtd". Each document contains a -- root element \ 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|