Anti-xml 将成为 Scala 中的后继 xml 库。但是我发现了一些奇怪的东西。
输入
package com.twitter.sample
import com.codecommit.antixml._
object ReadingNamespaceXml extends Application{
val xml = <tra:route xmlns:tra="trace">
<spo:id xmlnls:spo="sport">23232322</spo:id>
<tra:service ref="go" xsi:type="ref:manualService" xmlns:ref="ServiceRef"/>
</tra:route>.convert
val route = xml \ "route"
Console println route.unselect
}
输出:
<tra:route>
<spo:id xmlnls:spo="sport">23232322</spo:id>
<tra:service xsi:type="ref:manualService" ref="go"/>
</tra:route>
所以,输入的xml和输出是不一样的。为什么?