summaryrefslogtreecommitdiff
path: root/scala/movies.scala
blob: d8b145dde91bb043e7926e2f67e2afb6dbce9b6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
val movies = <movies>
  <movie>The incredibles</movie>
  <movie>WALL E</movie>
  <short>Jack Jack Attack</short>
  <short>Geri's Game</short>
</movies>

(movies \ "_").foreach { movie =>
  movie match {
    case <movie>{movieName}</movie> => println(movieName)
    case <short>{shortName}</short> => println(shortName + " (short)")
  }
}