0
考慮以下代碼:如何將代碼從HasKeyValue遷移到UnprefixedAttribute?
import scala.xml.{Node,HasKeyValue}
def domatch(x:Node): Node = {
val hasBar = new HasKeyValue("bar")
x match {
case Node("foo", hasBar(z), _*) => z
case _ => null
}
}
當編譯它,我收到以下警告:
error: class HasKeyValue in package xml is deprecated:
Use UnprefixedAttribute's extractor
應該如何的代碼是什麼樣子?
Mhh,但現在我不僅與屬性「bar」匹配...... – soc