ashawley on master
Update Scala.js to 1.0.0-RC1 Merge pull request #375 from as… (compare)
ashawley on v2.0.0-M1#sjs_1.0.0-RC1
Update Scala.js to 1.0.0-RC1 on… Publish Scala.js from tag in Tr… (compare)
object addScope extends scala.xml.transform.RewriteRule {
override def transform(n: scala.xml.Node): Seq[scala.xml.Node] = n match {
case elem: scala.xml.Elem =>
elem.copy(scope = elem.scope.copy(uri = "urn:CollectionResponse", parent = scala.xml.TopScope),
child = elem.child.map(addScope))
case n => n
}
}
val order = <order><ordernumber/></order>
addScope(order)
scala.xml.Utility.serialize
works on a StringBuilder
rather than something more abstract? As it seems like the only operation used is StringBuilder#append
, is there any reason it couldn't be reworked to use something like java.lang.Appendable
so that a java.io.Writer
could be provided (and the entire XML wouldn't have to exist as a huge string in memory )?
CanBuildFrom
is already gone in Scala 2.13, so CanBuildFrom
isn't a Scala 2 vs 3 difference
CanBuildFrom
is still present. but they expect to switch to the 2.13 stdlib quite soon
scala.xml.pull
, but it's deprecated, for good reasons.) I'd suggest looking into what Java XML libraries support streaming, and use one of those from Scala