def parseLeagueTable()

in src/main/scala/pa/Parser.scala [253:283]


  def parseLeagueTable(s: String): List[LeagueTableEntry] = {

    def parseLeagueStats(stats: NodeSeq) = LeagueStats(
      stats \> "played" toInt,
      stats \> "won" toInt,
      stats \> "drawn" toInt,
      stats \> "lost" toInt,
      stats \> "for" toInt,
      stats \> "against" toInt
    )

    (XML.loadString(s) \ "tableEntry") map { entry =>

      val team = entry \ "team"

      LeagueTableEntry(
        entry \> "stageNumber",
        parseRound(entry \ "round"),
        LeagueTeam(
          team \@ "teamID",
          team \@ "teamName",
          team \> "rank" toInt,
          parseLeagueStats(team),
          parseLeagueStats(team \ "home"),
          parseLeagueStats(team \ "away"),
          team \> "goalDifference" toInt,
          team \> "points" toInt
        )
      )
    }
  }