eed3si9n / scalaxb

scalaxb is an XML data binding tool for Scala.
http://scalaxb.org/
MIT License
337 stars 156 forks source link

Could not generate case classes from XSD with namespaces #507

Open mayurbarge opened 5 years ago

mayurbarge commented 5 years ago

Hello, We have a legacy JAXB project which converts XSDs to java classes. Recently we decided to migrate it on scala using scalaxb. The XSD's are downloaded from below link under folder "4_ICH_ICSR_Schema_Files" http://estri.ich.org/e2br3/E2B(R3)_IG_Complete_Package_v1_07.zip While running compile task I am getting below error Referenced type {urn:hl7-org:v3}CD was not found Kindly check to see if anything is missing in the configuration or what could be the issue.

My sbt configuration is


lazy val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.0.6"
lazy val scalaParser = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.6"
lazy val dispatchV = "0.12.0"
lazy val dispatch = "net.databinder.dispatch" %% "dispatch-core" % dispatchV

lazy val e2bSchema = (project in file(".")).
  enablePlugins(ScalaxbPlugin).
  settings(
    scalaxbPackageName in (Compile, scalaxb) := "generated",
    scalaxbDispatchVersion in (Compile, scalaxb) := dispatchV,
      scalaxbIgnoreUnknown in (Compile, scalaxb) := true,
      scalaxbAutoPackages in (Compile, scalaxb) := true,
      //scalaxbXsdSource  := file("src/main/xsd/E2BR3"),

      scalaxbPackageNames in (Compile, scalaxb)    := Map(

        uri("http://schemas.microsoft.com/2003/10/Serialization/") -> "coreschemas",
        uri("http://schemas.microsoft.com/2003/10/") -> "multicacheschemas"),
    libraryDependencies ++= Seq(dispatch),
    libraryDependencies ++= {
      if (scalaVersion.value startsWith "2.10") Seq()
      else Seq(scalaXml, scalaParser)
    }

)
mayurbarge commented 5 years ago

Here is the folder having xsd files

4_ICH_ICSR_Schema_Files.zip

fokot commented 5 years ago

Did you add Xsd sources?

    scalaxbXsdSource := (resourceDirectory in Compile).value / "xsd",
    scalaxbWsdlSource := (resourceDirectory in Compile).value / "wsdl",
    sources := Seq(scalaxbXsdSource.value / (base + ".xsd")),