1

scalaxb has generated the following case class definition based on my XSD:

case class Identifier(
   value: String,
   attributes: Map[String, scalaxb.DataRecord[Any]] = Map()) {
   lazy val typeValue = attributes("@type").as[String]
 }

I'm struggling with how to instance this case class (especially how to add to its attributes). Tried the below option

Identifier("name", Map("@attribute" -> scalaxb.DataRecord("attributeStringVal"))

When i tried to create a Map and pass it on to Identifier object, I am getting the below error while compiling the scala code

"could not find implicit value for evidence parameter of type scalaxb.CanWriteXML[String]".

Anyone faced similar issue?

Naren
  • 21
  • 3

1 Answers1

3

I had a similar error. In order to implicit scalaxb.CanWriteXML[String] to be available, you need to import the scalaxbPackageName. It can be found in xmlProtocol.scala trait. Assuming scalaxbPackageName is com.package.subpackage then you need to import com.package.subpackage._

Karan Ashar
  • 1,392
  • 1
  • 10
  • 23