jjzjj

UnprefixedAttribute

全部标签

xml - 如何在 Scala XML 输出中生成整数文字作为属性?

我希望以下代码生成具有以下内容的XML值:编译器报错scala>importscala.xml._importscala.xml._scala>valx:Int=10x:Int=10scala>:8:error:overloadedmethodconstructorUnprefixedAttributewithalternatives(String,Option[Seq[scala.xml.Node]],scala.xml.MetaData)scala.xml.UnprefixedAttribute(String,String,scala.xml.MetaData)scala.xml.

XML 创建 - 错误 : overloaded method constructor UnprefixedAttribute with alternatives

scala>valcount=7count:Int=7将其放入XML属性会产生错误:scala>valx=:8:error:overloadedmethodconstructorUnprefixedAttributewithalternatives:(key:String,value:Option[Seq[scala.xml.Node]],next:scala.xml.MetaData)scala.xml.UnprefixedAttribute(key:String,value:String,next:scala.xml.MetaData)scala.xml.UnprefixedAtt