Scala: how to create XML nodes from some collection

前端 未结 3 933
执念已碎
执念已碎 2020-12-15 23:20

If you have something like:

val myStuff = Array(Person(\"joe\",40), Person(\"mary\", 35))

How do you create an XML value with that data as

3条回答
  •  既然无缘
    2020-12-16 00:27

    Actually, the line yield person.toXml() does not compile for me, but yield person.toXml (without the parentheses) does. The original version complains of 'overloaded method value apply' even if I change the def of 'ToXml' to explicitly return a scala.xml.Elem

提交回复
热议问题