Giter Club home page Giter Club logo

scalaxb-old's Introduction

scalaxb

Join the chat at https://gitter.im/eed3si9n/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.

From schema documents scalaxb will generate Scala source files containing case classes to represent the data and typeclass instances to turn XML documents into an object, and the object back to XML.

Status

The latest is 1.4.1. Some things may not work. I'd really appreciate if you could run it against your favorite xsd file and let me know the result.

Modules

There are currently four ways of running scalaxb:

  • command line app scalaxb
  • sbt plugin sbt-scalaxb
  • maven plugin mvn-scalaxb
  • web API scalaxb-heroku hosted on heroku

sbt-scalaxb

To call scalaxb from sbt 0.13.x, put this in your project/scalaxb.sbt:

resolvers += Resolver.sonatypeRepo("public")
addSbtPlugin("org.scalaxb" % "sbt-scalaxb" % "X.X")

and this in scalaxb.sbt:

scalaxbSettings
packageName in scalaxb in Compile := "xxx"
sourceGenerators in Compile <+= scalaxb in Compile
dispatchVersion in scalaxb in Compile := "0.11.3"

command line app scalaxb

See INSTALL.md.

mvn-scalaxb

See mvn-scalaxb.

Documents

Further info is available at scalaxb.org.

Bug Reporting

If you're having problem with scalaxb, please take a moment and read issue reporting guideline.

Licensing

It's the MIT License. See the file called LICENSE.

Contacts

scalaxb-old's People

Contributors

eed3si9n avatar martiell avatar anatoliykmetyuk avatar lbruand avatar andrevandelft avatar lamdor avatar romainreuillon avatar coutopl avatar carl297r avatar mprihoda avatar maxaf avatar justjoheinz avatar dustinchaloupka avatar arkadius avatar alexdupre avatar colinrgodsey avatar joescii avatar joshlreese avatar pdalpra avatar rssh avatar gitter-badger avatar erwan56 avatar donderom avatar ecin avatar malaporte avatar

Watchers

James Cloos avatar  avatar

scalaxb-old's Issues

Generate Visitor code

To make the generated classes of scalaxb really useful for my OfficeOpenXML-related development project, we need some visitor infrastructure. There are several options:

  1. just make this provision for the generated scalaxb code of OpenOffice
  2. add a command line option to the scalaxb generator, to generate a visitor
  3. do something at run-time with macros

In docx4j, approach 1 was taken; see here. One drawback with this approach is that is limited to the OfficeOpen code. Moreover, there is no guaranty that every node is visited.

For jaxb, there is a better solution of type 2: a plug in to the code generator, that creates visitor code. See jaxb-visitor. We could mimic this as a command line option in scalaxb, rather than a plugin.

I think Tolya could also create macro's that generate the visitors at run time. I would prefer the command line option though since that seems easier to understand for slightly less advanced developers.

ConScript usage

I found that the usage of ConScript complicates this project.
First there is the hassle of installing ConScript on OSX.
Thereafter it was hard to work with it.

Fortunately Anatoliy created a deploy script for scalaxb that does not depend on ConScript.

Installing ConScript on OSX

Make sure wget has been installed

brew install wget

Download and run install script

curl https://raw.githubusercontent.com/foundweekends/conscript/master/setup.sh >setup-conscript.sh
chmod u+x setup-conscript.sh
./setup-conscript.sh

Working with Conscript

I wanted to compile scalaxb for Scala 2.10, rather than 2.11 which is standard on my system.
That is because compiling with 2.11 would cause these kinds of errors:

Note: during publish-local it is possible to get errors such as

    ...
    [info]  published ivy to /Users/andrevandelft/.ivy2/local/org.scalaxb/scalaxb_2.11/1.4.1-SNAPSHOT/ivys/ivy.xml
    [error] .../scalaxb/sbt-scalaxb/src/main/scala/sbtscalaxb/Plugin.scala:90: can't expand macros compiled by previous versions of Scala
    [error]     logLevel in scalaxb <<= logLevel?? Level.Info
    [error]                                              ^

Unfortunately ConScript wants to work with 2.11 on my system.
Why exactly is unknown. IMO the help should be clear how to change that, but it is not.

$ cs --local eed3si9n/scalaxb/1.4.1-SNAPSHOT
Getting org.scalaxb scalaxb_2.11 1.4.1-SNAPSHOT ...
        module not found: org.scalaxb#scalaxb_2.11;1.4.1-SNAPSHOT

After struggling with this for a while I gave up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.