This page is no longer maintained — Please continue to the home page at www.scala-lang.org

scalaxb: an XML data-binding tool for Scala

2 replies
eed3si9n
Joined: 2010-01-24,
User offline. Last seen 42 weeks 6 days ago.
Hi all,
I'd like to sheepishly announce scalaxb, an XML data-binding tool for Scala that supports W3C XML Schema.The development is still at humble stage, but it could use some feedback.
The idea is to generate case classes from XSD files, to handle XML documents more naturally in Scala.For example,
<xs:complexType name="Address"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="street" type="xs:string"/> <xs:element name="city" type="xs:string"/> </xs:sequence> </xs:complexType>
turns to   case class Address(name: String,    street: String,     city: String) extends DataModel with Addressable {  }    object Address {    def fromXML(node: scala.xml.Node): Address =       Address((node \ "name").text,        (node \ "street").text,         (node \ "city").text)   }
Further information is available at http://scalaxb.org. GitHub repo is at http://github.com/eed3si9n/scalaxb.
Thanks,e.e
Alex Cruise
Joined: 2008-12-17,
User offline. Last seen 2 years 26 weeks ago.
Re: scalaxb: an XML data-binding tool for Scala

On 3/17/2010 9:26 PM, e.e wrote:
> I'd like to sheepishly announce scalaxb, an XML data-binding tool for
> Scala that supports W3C XML Schema.
> The development is still at humble stage, but it could use some feedback.
>
> The idea is to generate case classes from XSD files, to handle XML
> documents more naturally in Scala.

This looks like a great start, e.e. I notice you're using the SAML
assertion schema as one of your test cases; the sight of it makes my
battle scars pulsate (I used to work at http://www.layer7tech.com/). :)

-0xe1a

eed3si9n
Joined: 2010-01-24,
User offline. Last seen 42 weeks 6 days ago.
Re: scalaxb: an XML data-binding tool for Scala
Getting SAML Metadata schema to produce case classes has been my milestone goal for the last several weeks.It pushed me to implement more advanced XML Schema features like importing since it uses types from four other schema (XML Signatures, XML Encryption, SAML assertions, and XML Namespace).
e.e
On Thu, Mar 18, 2010 at 12:43 AM, Alex Cruise <alex [at] cluonflux [dot] com> wrote:
On 3/17/2010 9:26 PM, e.e wrote:
I'd like to sheepishly announce scalaxb, an XML data-binding tool for Scala that supports W3C XML Schema.
The development is still at humble stage, but it could use some feedback.

The idea is to generate case classes from XSD files, to handle XML documents more naturally in Scala.

This looks like a great start, e.e.  I notice you're using the SAML assertion schema as one of your test cases; the sight of it makes my battle scars pulsate (I used to work at http://www.layer7tech.com/). :)

-0xe1a

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland