A common idiom in Java before Scala, go / list Java to Scala list
I am processing an XML document and iterating through the nodes. I want to iterate over the nodes and create a new list of some kind. How do I do it with Scala:
Here is my XML reverse code:
def findClassRef(xmlNode: Elem) = {
xmlNode\"classDef" foreach { (entry) =>
val name = entry \ "@name"
val classid = entry \ "@classId"
println(name + "//" + classid)
}
}
If there is a println line, I want to add items to the list.
+2
a source to share