42

我必须将字符串转换为 XML

scala> val string="<play><scala></scala></play>"
string: String = <play><scala></scala></play>

scala> val xml=(<play><scala></scala></play>)
xml: scala.xml.Elem = <play><scala></scala></play>
4

1 回答 1

66
scala> scala.xml.XML.loadString(string)
res0: scala.xml.Elem = <play><scala/></play>
于 2014-08-06T05:37:30.150 回答