scala noob here, I have a collection (Seq) of xml nodes, and I would like to populate an array based on each node:
val nodes = data.child \\"package"
var packages = new Array[Package](nodes.length)
var index = 0
for(val entry <- nodes) {
packages(index) = new Package(entry)
index = index+1
}
Despite the fact that it works, it does not look like "w61> -ish", and I'm sure there is a better way to do this.
Any ideas?
source
share