As a java programmer I'm quite comfortable with using JAXB and similar, for example to construct object from a XML spec.
I'm sure I can make JAXB work nice in scala, but I wonder if that is the scala way of doing it, or if there is some better/smarter way, especially since XML is almost part of the language / it's internal libraries.
So, given that I want to create a set of object form a XML spec, what's the recommended way to do this in scala?
For pure Scala, there is scalaxb. It generates case classes and parser based on Scala parser combinators. It's still quite young, but if you steer clear of the advanced features of XML Schema it is quite usable.
Ditto on Scalaxb.
Has an issue with '-' in class and field name, turns into "u45" !!
You can fix with this code, to fix in place with this gist:
PostProcessScalaxb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With