Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To compile XML syntax, the scala.xml package must be on the classpath [duplicate]

The following code in the compiler:

abstract class query {def get: Unit => scala.xml.Elem}

gives me the error: "object xml is not a member of package scala"

however when I use scala.xml.Elem in sbt through the command line it works just fine,

how do I fix this?

Thanks in advance

like image 792
zunior Avatar asked Nov 21 '22 08:11

zunior


1 Answers

Scala-XML has been factored out into a separate library as of Scala 2.11, so it is not included in Scala projects by default. To include it in your project via sbt add this dependency:

libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.0.2"
like image 157
Michael Zajac Avatar answered Nov 23 '22 22:11

Michael Zajac