scalaxb

scalaxb is an XML data-binding tool for Scala that supports W3C XML Schema (xsd) and Web Services Description Language (wsdl) as the input file.

status

The latest is Maven Central

Many things still may not work. I'd really appreciate if you could run it against your favorite xsd file and let me know the result.

usage

$ scalaxb [options] <schema_file>...
 
  -d <directory> | --outdir <directory>
        generated files will go into <directory>
  -p <package> | --default-package <package>
        specifies the target package
  --package:<namespaceURI>=<package>
        specifies the target package for <namespaceURI>
  --class-prefix <prefix>
        prefixes generated class names
  --param-prefix <prefix>
        prefixes generated parameter names
  --prepend-family
        prepends family name to class names
  --wrap-contents <complexType>
        wraps inner contents into a seperate case class
  --contents-limit <size>
        defines long contents to be segmented (default: 20)
  --chunk-size <size>
        segments long sequences into chunks (default: 10)
  --package-dir
        generates package directories
  --protocol-file <name.scala>
        protocol file name (xmlprotocol.scala)
  --protocol-package <package>
        package for protocols
  --no-runtime
        skips runtime files
  --lax-any
        relaxes namespace constraints of xs:any
  --blocking
        generates blocking SOAP client
  --dispatch-version <version>
        version of Dispatch (default: 0.11.1)
  -v | --verbose
        be extra verbose
  --help
        display this message
  --version
        display version info
  <schema_file>...
        input schema to be converted

sponsors

Thanks to YourKit for supporting scalaxb! YourKit Java Profiler works great for profiling Scala applications.

scalaxb 1.9.0

updates

  • Updates scala-xml to 2.x, and scala-parser-combinators to 2.x on Scala 2.13 #589 by @mrdziuban
  • Fixes type mismatch in scalaxb.scala #584 by @bodduv

behind the scene

quick start

$ sbt new eed3si9n/scalaxb.g8

scalaxb 1.8.3

scalaxb 1.8.2

  • Fixes "match may not be exhaustive." error on Scala 2.13 #565 by @kovstas
  • Fixes the code generation of attribute accessor to add attribute prefix #318/#558 by @etitov

scalaxb 1.8.1

bug fixes

  • Fixes whitespace handling when whitespace = collapse #556 by @jypma
  • Fixes reserved word handling for Monocle lens generation #539 by @deenar
  • Fixes Monocle lens generation when complexType and element are named the same #555 by @ihhha
  • Fixes random access performance in ElemNameSeqReader #544 by @omatzcoveo
  • Fixes SOAP action encoding #548 by @etitov

scalaxb 1.8.0

scalaxb 1.8.0 adds Monocle Lens generation feature.

scalaxb 1.7.5

  • Populates xsi:type attribute on toXML(...) #518 by @abestel
  • Adds scalaxbUseLists setting to generate List[A] instead of Seq[A] #526 by @pgrandjean
  • Fixes code generation to avoid multi-arg infix syntax #531 by @margussipria
  • Splits generated fromString method for big enums that would otherwise not compile #517 by @LolHens

scalaxb 1.7.3

enhancement

bug fix

  • Fixes the handling of attributes declared as sequences #512 by @abestel

scalaxb 1.7.2

bug fix

scalaxb 1.7.1

bug fixes

  • Fixes big decimal formatting according to XML Schema #483 by @danslapman
  • Fixes equals called on a String and Option[String] #485 by @lespea
  • Fixes one-way SOAP call #493 by @danslapman
Syndicate content