]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/Heartbeat.hs
Export a "dtd" function from each XML module and use that instead of hard-coding...
[dead/htsn-import.git] / src / TSN / XML / Heartbeat.hs
index a3a169347385b3197f018af5d914c4b1c5a6e266..89b91adb4605a35a1b6203c0ec2d578f0488b154 100644 (file)
@@ -3,6 +3,7 @@
 -- | Handle documents defined by Heartbeat.dtd.
 --
 module TSN.XML.Heartbeat (
+  dtd,
   verify,
   -- * Tests
   heartbeat_tests )
@@ -27,6 +28,11 @@ import TSN.DbImport ( ImportResult(..) )
 import Xml ( pickle_unpickle, unpickleable )
 
 
+-- | The DTD to which this module corresponds.
+--
+dtd :: String
+dtd = "Heartbeat.dtd"
+
 -- | The data structure that holds the XML representation of a
 --   Heartbeat message.
 --
@@ -63,7 +69,7 @@ verify :: XmlTree -> IO ImportResult
 verify xml = do
   let root_element = unpickleDoc pickle_message xml
   return $ case root_element of
-    Nothing -> ImportFailed "Could not unpickle document in import_generic."
+    Nothing -> ImportFailed "Could not unpickle document to be verified."
     Just _  -> ImportSkipped "Heartbeat received. Thump."
 
 --