Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

scala String to scala.xml.Elem

I have to convert a string into 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>
question from:https://stackoverflow.com/questions/25152738/scala-string-to-scala-xml-elem

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
scala> scala.xml.XML.loadString(string)
res0: scala.xml.Elem = <play><scala/></play>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...