+-- | We don't make 'WeatherForecastListingXml' an instance of
+-- 'FromXmlFk' because it needs some additional information, namely
+-- the league name from its containing \<league\> element.
+--
+-- When supplied with a forecast id and a league name, this will
+-- turn an XML listing into a database one.
+--
+from_xml_fk_league :: DefaultKey WeatherForecast
+ -> (Maybe String)
+ -> WeatherForecastListingXml
+ -> WeatherForecastListing
+from_xml_fk_league fk ln WeatherForecastListingXml{..} =
+ WeatherForecastListing {
+ db_weather_forecasts_id = fk,
+ db_league_name = ln,
+ db_teams = xml_teams,
+ db_weather = xml_weather }
+
+
+-- * WeatherLeague
+
+-- | XML representation of a league, as they appear in the weather
+-- documents. There is no associated database representation because
+-- the league element really adds no information besides its own
+-- (usually empty) name. The leagues contain listings, so we
+-- associate the league name with each listing instead.
+--