+-- from a document. If we fail to parse an XML_File_ID, we return
+-- the reason wrapped in a 'Left' constructor. The reason should be
+-- one of two things:
+--
+-- 1. No XML_File_ID elements were found.
+--
+-- 2. An XML_File_ID element was found, but it could not be read
+-- into an Integer.
+--
+-- We use an Either rather than a Maybe because we do expect some
+-- non-integer XML_File_IDs. In the examples, you will see
+-- NHL_DepthChart_XML.XML with an XML_File_ID of "49618.61" and
+-- CFL_Boxscore_XML1.xml with an XML_File_ID of "R28916". According
+-- to Brijesh Patel of TSN, these are special category files and not
+-- part of the usual feed.
+--
+-- We want to report them differently, "just in case."
+--
+parse_xmlfid :: String -- ^ The XML Document
+ -> Either String Integer
+parse_xmlfid doc =
+ case parse_results of
+ [] -> Left "No XML_File_ID elements found."
+ (x:_) -> x