任何人都可以告訴我如何將「xml」標籤寫入輸出嗎?正如預期的那樣,loadString()方法在加載時擺脫它。如何使用scala.xml和Play Framework編寫<?xml>標籤
object SitemapController extends Controller {
def validDeals = Action { implicit request =>
val xmlStr = "<?xml version="1.0" encoding="UTF-8"?><msg>There's no xml tag</msg>"
Ok(scala.xml.XML.loadString(xmlStr))
}
}
我從控制器獲得貝克只是
<msg>There's no xml tag</msg>