Scala XML support and XSD

666 views
Skip to first unread message

Edmondo Porcu

unread,
Oct 29, 2012, 9:07:34 AM10/29/12
to scala...@googlegroups.com

Dear all,

I would like to use Scala to develop restful web services.

 

How can I produce XSD files and XML representation in a coherent way? Is there a tool to produce XML using XSD for a given class?

 

If, on any of my class, I have a toXml and toXsd, how could I validate one against the other?

 

 

Best Regards

 

 

 

Edmondo Porcu

 

 


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

Daniel Sobral

unread,
Oct 29, 2012, 12:14:10 PM10/29/12
to Edmondo Porcu, scala...@googlegroups.com
I've once looked into the same thing. At the time, things did not look
very good, but, hopefully, they have improved since. See
http://stackoverflow.com/questions/471150/whats-the-best-xsd-xml-schema-authoring-tool
for suggestions.

If I needed that right now, I'd use Liquid XML.
--
Daniel C. Sobral

I travel to the future all the time.

mike myers

unread,
Oct 31, 2012, 9:48:51 AM10/31/12
to scala...@googlegroups.com, Edmondo Porcu
I would have suggested LiquidXML also, they also have an online xsd tool as well,

http://www.liquid-technologies.com/FreeXmlTools/FreeXmlValidator.aspx

Rafał Krzewski

unread,
Nov 1, 2012, 8:42:55 AM11/1/12
to scala...@googlegroups.com
There's a couple different themes you've mentioned in your message:
If you are after native Scala framework for RESTful web services you could take a look at https://github.com/jdegoes/blueeyes
If you want to map objects to XML and back, you could try http://scalaxb.org/ but it supports schema-first devlopment only (ie generates Scala sources from XSD)
If you want to go into opposite direction, you could look for some Java based tools that operate on binary classes. I had a quick look at JAXB tools for Java and it appears that class first development depends on processing Java sources, so they would not be useful for you.
Finally, if you need to validate XML files against XSD schema programatically, you could use javax.xml.valiation facility which as been part of Java JRE since release 1.5.

Cheers,
Rafał
Reply all
Reply to author
Forward
0 new messages