- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
What version of schema2src works with what Scala version?
Mon, 2009-06-15, 13:48
Hello everyone,
I am looking for a working combination of the schema2src tool and a Scala version.
I test with some Scala and schema2src versions:
After unpacking a Scala Version I add schema2src via "sbaz install schema2src" in this specific Scala version.
>\scala-2.7.5.final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxesUt
ility
at schema2src.Main$.processArgs(Main.scala:56)
>\scala-2.7.0-final\bin\schema2src dtd -d /tmp ComponentInfo.xsd out
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxedIn
t
at schema2src.Main$.processArgs(Main.scala:51)
I find that just before the Release of 2.7.0 BoxesUtility is deleted from Scala Lib.
So I try another version:
>\scala-2.6.1-final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoSuchMethodError: scala.Seq$.unapplySeq(Ls
cala/Seq;)Lscala/Option;
at schema2src.Main$.processArgs(Main.scala:56)
I try also the lastest, nightly Scala version, but because there is no sbaz coming with it I copy Schema2src from 2.7.5.final to the last version:
>\scala-2.8.0.r18030-b20090615020147\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Seq
at schema2src.Main.main(Main.scala)
Now I get the latest source from schema2src via the Webbrowers of SVN
(http://lampsvn.epfl.ch/trac/scala/browser/scalax/trunk/schema2src/src/schema2src)
and put it into my eclipse IDE (with 2.7.5.final plugin installed).
This also don't work; it even don't compile.
Because I am new to Scala (I have only commercial know how in Objective-C; C++ and Java; not in Huskell and such things) I can not find
what is wrong with the code.
Main.scala: 38:
val mod = theModule.get(null).asInstanceOf[Module]
not found type Module
However there is a Module.scala alongside of Main.scala
xsd\GenSource.scala: 62:
return <moresource>
I encountered a '}' where I didn't expected one, maybe this tag isnn't closed <moresource>
And 5 another red dots indication a compile error.
My hope was that I get generated code to read my xml file and by using this code I can start learning Scala.
Bye
Robert
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
Mon, 2009-06-15, 16:27
#2
RE: What version of schema2src works with what Scala version?
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
Hi Daniel,
I have checked it now ;-)
Unfortunaly that is not the reason for failure. After setting java -verbose:class I get this:
[Loaded schema2src.Main from file:/I:/scala-2.7.5.final/lib/schema2src.jar]
[Loaded scala.ScalaObject from I:\SCALA-~2.FIN\bin\..\lib\scala-library.jar]
So the classes are there.
I checked the BoxesUtility class and found a notice that it was deleted in svn during
cleanup for scala 2.7.0. With other version other classes are missing. Any idea?
Thanks
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 16:44
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what
Scala version?
Do you have Scala's library in the CLASSPATH? Or SCALA_HOME set?
On Mon, Jun 15, 2009 at 9:48 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hello everyone,
I am looking for a working combination of the schema2src tool and a Scala version.
I test with some Scala and schema2src versions:
After unpacking a Scala Version I add schema2src via "sbaz install schema2src" in this specific Scala version.
>\scala-2.7.5.final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxesUt
ility
at schema2src.Main$.processArgs(Main.scala:56)
>\scala-2.7.0-final\bin\schema2src dtd -d /tmp ComponentInfo.xsd out
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxedIn
t
at schema2src.Main$.processArgs(Main.scala:51)
I find that just before the Release of 2.7.0 BoxesUtility is deleted from Scala Lib.
So I try another version:
>\scala-2.6.1-final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoSuchMethodError: scala.Seq$.unapplySeq(Ls
cala/Seq;)Lscala/Option;
at schema2src.Main$.processArgs(Main.scala:56)
I try also the lastest, nightly Scala version, but because there is no sbaz coming with it I copy Schema2src from 2.7.5.final to the last version:
>\scala-2.8.0.r18030-b20090615020147\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Seq
at schema2src.Main.main(Main.scala)
Now I get the latest source from schema2src via the Webbrowers of SVN
(http://lampsvn.epfl.ch/trac/scala/browser/scalax/trunk/schema2src/src/schema2src)
and put it into my eclipse IDE (with 2.7.5.final plugin installed).
This also don't work; it even don't compile.
Because I am new to Scala (I have only commercial know how in Objective-C; C++ and Java; not in Huskell and such things) I can not find
what is wrong with the code.
Main.scala: 38:
val mod = theModule.get(null).asInstanceOf[Module]
not found type Module
However there is a Module.scala alongside of Main.scala
xsd\GenSource.scala: 62:
return <moresource>
I encountered a '}' where I didn't expected one, maybe this tag isnn't closed <moresource>
And 5 another red dots indication a compile error.
My hope was that I get generated code to read my xml file and by using this code I can start learning Scala.
Bye
Robert
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
Mon, 2009-06-15, 16:27
#3
Re: What version of schema2src works with what Scala version?
Then it looks like schema2src is out of date (for quite a while) with Scala.
On Mon, Jun 15, 2009 at 11:59 AM, Risch, Robert <robert.risch@philips.com> wrote:
--
Daniel C. Sobral
Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value.
On Mon, Jun 15, 2009 at 11:59 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hi Daniel,
I have checked it now ;-)
Unfortunaly that is not the reason for failure. After setting java -verbose:class I get this:
[Loaded schema2src.Main from file:/I:/scala-2.7.5.final/lib/schema2src.jar]
[Loaded scala.ScalaObject from I:\SCALA-~2.FIN\bin\..\lib\scala-library.jar]
So the classes are there.
I checked the BoxesUtility class and found a notice that it was deleted in svn during
cleanup for scala 2.7.0. With other version other classes are missing. Any idea?
Thanks
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 16:44
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what Scala version?
Do you have Scala's library in the CLASSPATH? Or SCALA_HOME set?
On Mon, Jun 15, 2009 at 9:48 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hello everyone,
I am looking for a working combination of the schema2src tool and a Scala version.
I test with some Scala and schema2src versions:
After unpacking a Scala Version I add schema2src via "sbaz install schema2src" in this specific Scala version.
>\scala-2.7.5.final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxesUt
ility
at schema2src.Main$.processArgs(Main.scala:56)
>\scala-2.7.0-final\bin\schema2src dtd -d /tmp ComponentInfo.xsd out
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxedIn
t
at schema2src.Main$.processArgs(Main.scala:51)
I find that just before the Release of 2.7.0 BoxesUtility is deleted from Scala Lib.
So I try another version:
>\scala-2.6.1-final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoSuchMethodError: scala.Seq$.unapplySeq(Ls
cala/Seq;)Lscala/Option;
at schema2src.Main$.processArgs(Main.scala:56)
I try also the lastest, nightly Scala version, but because there is no sbaz coming with it I copy Schema2src from 2.7.5.final to the last version:
>\scala-2.8.0.r18030-b20090615020147\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Seq
at schema2src.Main.main(Main.scala)
Now I get the latest source from schema2src via the Webbrowers of SVN
(http://lampsvn.epfl.ch/trac/scala/browser/scalax/trunk/schema2src/src/schema2src)
and put it into my eclipse IDE (with 2.7.5.final plugin installed).
This also don't work; it even don't compile.
Because I am new to Scala (I have only commercial know how in Objective-C; C++ and Java; not in Huskell and such things) I can not find
what is wrong with the code.
Main.scala: 38:
val mod = theModule.get(null).asInstanceOf[Module]
not found type Module
However there is a Module.scala alongside of Main.scala
xsd\GenSource.scala: 62:
return <moresource>
I encountered a '}' where I didn't expected one, maybe this tag isnn't closed <moresource>
And 5 another red dots indication a compile error.
My hope was that I get generated code to read my xml file and by using this code I can start learning Scala.
Bye
Robert
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
--
Daniel C. Sobral
Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value.
--
Daniel C. Sobral
Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value.
Mon, 2009-06-15, 16:57
#4
RE: What version of schema2src works with what Scala version?
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
Is there an other tool to generate code from a DTD? Or where can I find example Scala code that
perform data binding with an xml file? My xml file is not very complex, so I can adapt the example.
The document ScalaByExample promise:
Pattern matching over class hierarchies unifies functional and objectoriented
data access. It greatly simplifies the processing of XML trees.
I have also checked scala.xml. This book recomment the schema2src tool.
But I don't want to code from scratch with java or use a DTD to java generator because I want to
learn a little bit Scala by solving the problem.
Bye
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 17:16
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what
Scala version?
Then it looks like schema2src is out of date (for quite a while) with Scala.
On Mon, Jun 15, 2009 at 11:59 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hi Daniel,
I have checked it now ;-)
Unfortunaly that is not the reason for failure. After setting java -verbose:class I get this:
[Loaded schema2src.Main from file:/I:/scala-2.7.5.final/lib/schema2src.jar]
[Loaded scala.ScalaObject from I:\SCALA-~2.FIN\bin\..\lib\scala-library.jar]
So the classes are there.
I checked the BoxesUtility class and found a notice that it was deleted in svn during
cleanup for scala 2.7.0. With other version other classes are missing. Any idea?
Thanks
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 16:44
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what
Scala version?
Do you have Scala's library in the CLASSPATH? Or SCALA_HOME set?
On Mon, Jun 15, 2009 at 9:48 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hello everyone,
I am looking for a working combination of the schema2src tool and a Scala version.
I test with some Scala and schema2src versions:
After unpacking a Scala Version I add schema2src via "sbaz install schema2src" in this specific Scala version.
>\scala-2.7.5.final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxesUt
ility
at schema2src.Main$.processArgs(Main.scala:56)
>\scala-2.7.0-final\bin\schema2src dtd -d /tmp ComponentInfo.xsd out
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxedIn
t
at schema2src.Main$.processArgs(Main.scala:51)
I find that just before the Release of 2.7.0 BoxesUtility is deleted from Scala Lib.
So I try another version:
>\scala-2.6.1-final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoSuchMethodError: scala.Seq$.unapplySeq(Ls
cala/Seq;)Lscala/Option;
at schema2src.Main$.processArgs(Main.scala:56)
I try also the lastest, nightly Scala version, but because there is no sbaz coming with it I copy Schema2src from 2.7.5.final to the last version:
>\scala-2.8.0.r18030-b20090615020147\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Seq
at schema2src.Main.main(Main.scala)
Now I get the latest source from schema2src via the Webbrowers of SVN
(http://lampsvn.epfl.ch/trac/scala/browser/scalax/trunk/schema2src/src/schema2src)
and put it into my eclipse IDE (with 2.7.5.final plugin installed).
This also don't work; it even don't compile.
Because I am new to Scala (I have only commercial know how in Objective-C; C++ and Java; not in Huskell and such things) I can not find
what is wrong with the code.
Main.scala: 38:
val mod = theModule.get(null).asInstanceOf[Module]
not found type Module
However there is a Module.scala alongside of Main.scala
xsd\GenSource.scala: 62:
return <moresource>
I encountered a '}' where I didn't expected one, maybe this tag isnn't closed <moresource>
And 5 another red dots indication a compile error.
My hope was that I get generated code to read my xml file and by using this code I can start learning Scala.
Bye
Robert
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
Tue, 2009-06-16, 12:57
#5
Re: What version of schema2src works with what Scala version?
Guys,
Is there any reason not to just use JAXB and then the Scala/Java interop?
Best wishes,
--greg
On Mon, Jun 15, 2009 at 8:47 AM, Risch, Robert <robert.risch@philips.com> wrote:
Is there any reason not to just use JAXB and then the Scala/Java interop?
Best wishes,
--greg
On Mon, Jun 15, 2009 at 8:47 AM, Risch, Robert <robert.risch@philips.com> wrote:
Is there an other tool to generate code from a DTD? Or where can I find example Scala code that
perform data binding with an xml file? My xml file is not very complex, so I can adapt the example.
The document ScalaByExample promise:
Pattern matching over class hierarchies unifies functional and objectoriented
data access. It greatly simplifies the processing of XML trees.
I have also checked scala.xml. This book recomment the schema2src tool.
But I don't want to code from scratch with java or use a DTD to java generator because I want to
learn a little bit Scala by solving the problem.
Bye
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 17:16
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what Scala version?
Then it looks like schema2src is out of date (for quite a while) with Scala.
On Mon, Jun 15, 2009 at 11:59 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hi Daniel,
I have checked it now ;-)
Unfortunaly that is not the reason for failure. After setting java -verbose:class I get this:
[Loaded schema2src.Main from file:/I:/scala-2.7.5.final/lib/schema2src.jar]
[Loaded scala.ScalaObject from I:\SCALA-~2.FIN\bin\..\lib\scala-library.jar]
So the classes are there.
I checked the BoxesUtility class and found a notice that it was deleted in svn during
cleanup for scala 2.7.0. With other version other classes are missing. Any idea?
Thanks
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 16:44
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what Scala version?
Do you have Scala's library in the CLASSPATH? Or SCALA_HOME set?
On Mon, Jun 15, 2009 at 9:48 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hello everyone,
I am looking for a working combination of the schema2src tool and a Scala version.
I test with some Scala and schema2src versions:
After unpacking a Scala Version I add schema2src via "sbaz install schema2src" in this specific Scala version.
>\scala-2.7.5.final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxesUt
ility
at schema2src.Main$.processArgs(Main.scala:56)
>\scala-2.7.0-final\bin\schema2src dtd -d /tmp ComponentInfo.xsd out
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxedIn
t
at schema2src.Main$.processArgs(Main.scala:51)
I find that just before the Release of 2.7.0 BoxesUtility is deleted from Scala Lib.
So I try another version:
>\scala-2.6.1-final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoSuchMethodError: scala.Seq$.unapplySeq(Ls
cala/Seq;)Lscala/Option;
at schema2src.Main$.processArgs(Main.scala:56)
I try also the lastest, nightly Scala version, but because there is no sbaz coming with it I copy Schema2src from 2.7.5.final to the last version:
>\scala-2.8.0.r18030-b20090615020147\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Seq
at schema2src.Main.main(Main.scala)
Now I get the latest source from schema2src via the Webbrowers of SVN
(http://lampsvn.epfl.ch/trac/scala/browser/scalax/trunk/schema2src/src/schema2src)
and put it into my eclipse IDE (with 2.7.5.final plugin installed).
This also don't work; it even don't compile.
Because I am new to Scala (I have only commercial know how in Objective-C; C++ and Java; not in Huskell and such things) I can not find
what is wrong with the code.
Main.scala: 38:
val mod = theModule.get(null).asInstanceOf[Module]
not found type Module
However there is a Module.scala alongside of Main.scala
xsd\GenSource.scala: 62:
return <moresource>
I encountered a '}' where I didn't expected one, maybe this tag isnn't closed <moresource>
And 5 another red dots indication a compile error.
My hope was that I get generated code to read my xml file and by using this code I can start learning Scala.
Bye
Robert
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
Wed, 2009-06-17, 11:07
#6
RE: What version of schema2src works with what Scala version?
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
Hi Greg,
thank you for the tip.
However it was said that Scala is well suited for processing XML trees.
If the data binding is performed in the Java part I can also use
Java for the whole thing. Because of the better IDE and Tool support
of Java this is probably the fastes solution for the problem.
I will continue trying it with Scala because I want to train myself.
If I fail I will take a look into JAXB.
Bye
Robert
From: Meredith Gregory
[mailto:lgreg.meredith@gmail.com]
Sent: Dienstag, 16. Juni 2009 13:44
To: Risch, Robert
Cc: Daniel Sobral; scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what
Scala version?
Guys,
Is there any reason not to just use JAXB and then the Scala/Java interop?
Best wishes,
--greg
On Mon, Jun 15, 2009 at 8:47 AM, Risch, Robert <robert.risch@philips.com> wrote:
Is there an other tool to generate code from a DTD? Or where can I find example Scala code that
perform data binding with an xml file? My xml file is not very complex, so I can adapt the example.
The document ScalaByExample promise:
Pattern matching over class hierarchies unifies functional and objectoriented
data access. It greatly simplifies the processing of XML trees.
I have also checked scala.xml. This book recomment the schema2src tool.
But I don't want to code from scratch with java or use a DTD to java generator because I want to
learn a little bit Scala by solving the problem.
Bye
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 17:16
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what
Scala version?
Then it looks like schema2src is out of date (for quite a while) with Scala.
On Mon, Jun 15, 2009 at 11:59 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hi Daniel,
I have checked it now ;-)
Unfortunaly that is not the reason for failure. After setting java -verbose:class I get this:
[Loaded schema2src.Main from file:/I:/scala-2.7.5.final/lib/schema2src.jar]
[Loaded scala.ScalaObject from I:\SCALA-~2.FIN\bin\..\lib\scala-library.jar]
So the classes are there.
I checked the BoxesUtility class and found a notice that it was deleted in svn during
cleanup for scala 2.7.0. With other version other classes are missing. Any idea?
Thanks
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 16:44
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what
Scala version?
Do you have Scala's library in the CLASSPATH? Or SCALA_HOME set?
On Mon, Jun 15, 2009 at 9:48 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hello everyone,
I am looking for a working combination of the schema2src tool and a Scala version.
I test with some Scala and schema2src versions:
After unpacking a Scala Version I add schema2src via "sbaz install schema2src" in this specific Scala version.
>\scala-2.7.5.final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxesUt
ility
at schema2src.Main$.processArgs(Main.scala:56)
>\scala-2.7.0-final\bin\schema2src dtd -d /tmp ComponentInfo.xsd out
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxedIn
t
at schema2src.Main$.processArgs(Main.scala:51)
I find that just before the Release of 2.7.0 BoxesUtility is deleted from Scala Lib.
So I try another version:
>\scala-2.6.1-final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoSuchMethodError: scala.Seq$.unapplySeq(Ls
cala/Seq;)Lscala/Option;
at schema2src.Main$.processArgs(Main.scala:56)
I try also the lastest, nightly Scala version, but because there is no sbaz coming with it I copy Schema2src from 2.7.5.final to the last version:
>\scala-2.8.0.r18030-b20090615020147\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Seq
at schema2src.Main.main(Main.scala)
Now I get the latest source from schema2src via the Webbrowers of SVN
(http://lampsvn.epfl.ch/trac/scala/browser/scalax/trunk/schema2src/src/schema2src)
and put it into my eclipse IDE (with 2.7.5.final plugin installed).
This also don't work; it even don't compile.
Because I am new to Scala (I have only commercial know how in Objective-C; C++ and Java; not in Huskell and such things) I can not find
what is wrong with the code.
Main.scala: 38:
val mod = theModule.get(null).asInstanceOf[Module]
not found type Module
However there is a Module.scala alongside of Main.scala
xsd\GenSource.scala: 62:
return <moresource>
I encountered a '}' where I didn't expected one, maybe this tag isnn't closed <moresource>
And 5 another red dots indication a compile error.
My hope was that I get generated code to read my xml file and by using this code I can start learning Scala.
Bye
Robert
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
Wed, 2009-06-17, 14:47
#7
Re: What version of schema2src works with what Scala version?
Risch, Robert wrote:
> (...)
> However it was said that Scala is well suited for processing XML trees.
I think this is wishful thinking. XML support in scala itself does not scale
at all. It's nice for little toy examples, but once you're out in the real
world, it sadly doesn't help you too far. Two examples of shortcomings /
failures of current XML support are:
- can't use XPath for matching
- basically no namespace support (neither on patterns nor on literals)
In the end after trying it out on processing inputs in different XML
vocabularies, I ended up using JAXB. schema2src is supposed to be "impossible
to complete" (which I doubt, but I suppose I have to have its blood on my
hands to really tell).
All I can do about it is not care atm, and return to the issue once I have
time enough and finished other, more pressing tasks. From my perspective,
don't hold your breath for 'proper' XML support.
> Because of the better IDE and Tool support
> of Java this is probably the fastes solution for the problem.
I dunno. If a language requires an IDE and tool support for you to be
productive in it, there's something wrong with the language. So if you want to
train yourself, why not in a language that does not require IDE and tool support.
-Martin
Wed, 2009-06-17, 14:57
#8
Re: What version of schema2src works with what Scala version?
Can't comment on full XPath in Scala as I haven't yet had to use the XML support in anger, but it definitely has namespace support.
If you were specifically thinking about namespace support when pattern matching, then here is a good place to start.
Of course, given the possibilities for pattern matching via Elem(_*), you can duplicate a lot of functionality of XPath by using for-comprehensions.
On Wed, Jun 17, 2009 at 2:46 PM, Martin S. Weber <martin.weber@nist.gov> wrote:
Risch, Robert wrote:
> (...)
However it was said that Scala is well suited for processing XML trees.
I think this is wishful thinking. XML support in scala itself does not scale at all. It's nice for little toy examples, but once you're out in the real
world, it sadly doesn't help you too far. Two examples of shortcomings / failures of current XML support are:
- can't use XPath for matching
- basically no namespace support (neither on patterns nor on literals)
In the end after trying it out on processing inputs in different XML vocabularies, I ended up using JAXB. schema2src is supposed to be "impossible to complete" (which I doubt, but I suppose I have to have its blood on my hands to really tell).
All I can do about it is not care atm, and return to the issue once I have time enough and finished other, more pressing tasks. From my perspective, don't hold your breath for 'proper' XML support.
> Because of the better IDE and Tool support
> of Java this is probably the fastes solution for the problem.
I dunno. If a language requires an IDE and tool support for you to be productive in it, there's something wrong with the language. So if you want to train yourself, why not in a language that does not require IDE and tool support.
-Martin
Wed, 2009-06-17, 16:07
#9
Re: What version of schema2src works with what Scala version?
I'll second the complain about XPath. What is there is a joke which barely gets you off the ground compared to real XPath.
Yes, for comprehensions make up for it, but you'll get 10-20 lines for expressions for any halfway complex XPath expression. I find it silly that Scala goes out of its way to make XML a literal completely integrated with the language, but then leave off on something that could be easy done through library like an XPath processor (from a string literal) or sugaring functions.
I wish regexp had that kind of support -- as literals -- in Scala. As it is, regexp heavy users, particularly those with background in languages that fully support them, have to tread carefully in Scala. The triple quotes syntax will help you most of the time, but then you want to use \u, and you have to revert to single quotes and lots of escaping, as the triple quotes will interpret \u as a unicode char, but won't let you escape the backslash.
I'll grant, though, that processing XML through Scala for comprehensions is a good thing. I'm very happy with the project that make database accesses that way, instead of injecting SQL-like code in the language. But, still, XPath, just as XML, is a standard. Any language claiming to have good support for XML must understand XML, XPath, XQuery, XSLT, XSD and DTD at a minimum.
On Wed, Jun 17, 2009 at 10:46 AM, Martin S. Weber <martin.weber@nist.gov> wrote:
--
Daniel C. Sobral
Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value.
On Wed, Jun 17, 2009 at 10:46 AM, Martin S. Weber <martin.weber@nist.gov> wrote:
Risch, Robert wrote:
> (...)
However it was said that Scala is well suited for processing XML trees.
I think this is wishful thinking. XML support in scala itself does not scale at all. It's nice for little toy examples, but once you're out in the real
world, it sadly doesn't help you too far. Two examples of shortcomings / failures of current XML support are:
- can't use XPath for matching
- basically no namespace support (neither on patterns nor on literals)
In the end after trying it out on processing inputs in different XML vocabularies, I ended up using JAXB. schema2src is supposed to be "impossible to complete" (which I doubt, but I suppose I have to have its blood on my hands to really tell).
All I can do about it is not care atm, and return to the issue once I have time enough and finished other, more pressing tasks. From my perspective, don't hold your breath for 'proper' XML support.
> Because of the better IDE and Tool support
> of Java this is probably the fastes solution for the problem.
I dunno. If a language requires an IDE and tool support for you to be productive in it, there's something wrong with the language. So if you want to train yourself, why not in a language that does not require IDE and tool support.
-Martin
--
Daniel C. Sobral
Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value.
Wed, 2009-06-17, 16:27
#10
RE: What version of schema2src works with what Scala version?
> I'll second the complain about XPath. What is there is a joke
> which barely gets you off the ground compared to real XPath.
[...]
> I find it silly that Scala goes out of its way to
> make XML a literal completely integrated with the language,
> but then leave off on something that could be easy done
> through library like an XPath processor (from a string
> literal) or sugaring functions.
Well, every now and then such thoughts stroll through my
mind too and I miss this and that.
But OTOH: When it is so easily done with libraries or
sugaring functions, why not create them?
Honestly, what the EPFL team has done is mainly creating
and improving Scala-the-language to make it exactly possible
to create fancy stuff more easily, even in XML areas.
Beside that they worked on core things like the collection
library and the Actor things and the like.
Sometimes the expectations to get now a fully evolved
and ready to use library ecosystem for all the application
areas we are working in far exceeds what is achievable for
such a young language, a relatively small team, and a just
starting to grow community.
The fact that there is yet so much attention, a (as it seems)
powerful web framework, existing and evolving IDE support,
GUI library support and more is in my opinion astonishing
for the short time Scala is in the public, especially as
attention was more directed to Groovy in the first time.
Think of it: Scala only begins to gain attraction by
commercial companies.
Just my 2ct
Det
Wed, 2009-06-17, 16:37
#11
Re: What version of schema2src works with what Scala version?
On Wednesday June 17 2009, Martin S. Weber wrote:
> ...
>
> I dunno. If a language requires an IDE and tool support for you to be
> productive in it, there's something wrong with the language. ...
I think serious software development and engineering has passed the
point where this is a sensible perspective. Would we want mechanical
engineers to forgo CAD software? Just take our chances that crude
stress calculations don't leave us with bridges and buildings that
might fall down? Should electrical engineers use only pencil and paper
in their design work? Be satisfied with electrical grids that collapse
twice a year instead of once a decade? Do we want doctors to diagnose
and treat based solely on what their unaided senses can tell them? And
so on.
Tools enable advancement. Saying you'll only work with technologies that
don't demand tools is much too self-limiting.
> -Martin
Randall Schulz
Wed, 2009-06-17, 16:37
#12
RE: What version of schema2src works with what Scala version?
> Do we want doctors to diagnose and treat based solely
> on what their unaided senses can tell them?
Well, this somewhat misses the point.
I at least do not want to die on the street
with a doctor passing by saying:
"Sorry, I would help you, but I can't do
any diagnosis without my hightech equipment
at hand ..."
Emergency medicine and paramedic education have
evolved too and should do that furthermore.
Having monthly more powerful computers today doesn't
mean that mathematicians shouldn't put time in
inventing better algorithms for calculations.
All in all, the tool shall not replace the improvement
of the basics.
My opinion
Det
Wed, 2009-06-17, 16:47
#13
Re: What version of schema2src works with what Scala version?
A bit of this is the pampering that people have become accustomed to from modern IDEs. The exploration & learning of a new language is more effort without thorough IDE support. Developers are getting fussy. However, a new language that inheritly increases productivity enough use will likely gain the necessary IDE support.
Jon
On Wed, Jun 17, 2009 at 11:18 AM, Randall R Schulz <rschulz@sonic.net> wrote:
Jon
On Wed, Jun 17, 2009 at 11:18 AM, Randall R Schulz <rschulz@sonic.net> wrote:
On Wednesday June 17 2009, Martin S. Weber wrote:
> ...
>
> I dunno. If a language requires an IDE and tool support for you to be
> productive in it, there's something wrong with the language. ...
I think serious software development and engineering has passed the
point where this is a sensible perspective. Would we want mechanical
engineers to forgo CAD software? Just take our chances that crude
stress calculations don't leave us with bridges and buildings that
might fall down? Should electrical engineers use only pencil and paper
in their design work? Be satisfied with electrical grids that collapse
twice a year instead of once a decade? Do we want doctors to diagnose
and treat based solely on what their unaided senses can tell them? And
so on.
Tools enable advancement. Saying you'll only work with technologies that
don't demand tools is much too self-limiting.
> -Martin
Randall Schulz
Wed, 2009-06-17, 16:47
#14
Re: What version of schema2src works with what Scala version?
There are entire branches of mathematics now being explored that simply wouldn't be possible without increasingly powerful computers. Complexity, chaos, fractals, etc. Would anyone seriously suggest that we try and explore properties of the mandelbrot set doing calculations by hand?
Paramedics too have benefitted from tools, I'd defy anyone to find an ambulance that doesn't have a defibrilator available. Although I'd expect medics to know CPR, I'd be seriously worried if they didn't nevertheless use the tools that made them even more effective.
IDEs help us to deal with a codebase in whatever manney most closely fits the appropriate mental model, that and successive levels of abstraction are the real keys to improving productivity.
On Wed, Jun 17, 2009 at 4:32 PM, Detering Dirk <Dirk.Detering@bitmarck.de> wrote:
Paramedics too have benefitted from tools, I'd defy anyone to find an ambulance that doesn't have a defibrilator available. Although I'd expect medics to know CPR, I'd be seriously worried if they didn't nevertheless use the tools that made them even more effective.
IDEs help us to deal with a codebase in whatever manney most closely fits the appropriate mental model, that and successive levels of abstraction are the real keys to improving productivity.
On Wed, Jun 17, 2009 at 4:32 PM, Detering Dirk <Dirk.Detering@bitmarck.de> wrote:
> Do we want doctors to diagnose and treat based solely
> on what their unaided senses can tell them?
Well, this somewhat misses the point.
I at least do not want to die on the street
with a doctor passing by saying:
"Sorry, I would help you, but I can't do
any diagnosis without my hightech equipment
at hand ..."
Emergency medicine and paramedic education have
evolved too and should do that furthermore.
Having monthly more powerful computers today doesn't
mean that mathematicians shouldn't put time in
inventing better algorithms for calculations.
All in all, the tool shall not replace the improvement
of the basics.
My opinion
Det
Wed, 2009-06-17, 16:47
#15
Re: What version of schema2src works with what Scala version?
On Wednesday June 17 2009, Detering Dirk wrote:
> > Do we want doctors to diagnose and treat based solely
> > on what their unaided senses can tell them?
>
> Well, this somewhat misses the point.
>
> I at least do not want to die on the street
> with a doctor passing by saying:
> "Sorry, I would help you, but I can't do
> any diagnosis without my hightech equipment
> at hand ..."
> Emergency medicine and paramedic education have
> evolved too and should do that furthermore.
Well, clearly the analogy breaks down there. Treating trauma usually
doesn't involve microscopic evidence, but treating infections, cancers
and genetic disorders does.
> Having monthly more powerful computers today doesn't
> mean that mathematicians shouldn't put time in
> inventing better algorithms for calculations.
This seems to be a non-sequitur.
> All in all, the tool shall not replace the improvement
> of the basics.
Nothing I said contradicts this.
The original assertion I contested was this:
On Wednesday June 17 2009, Martin S. Weber wrote:
>> If a language requires an IDE and tool support for you to be
>> productive in it, there's something wrong with the language.
I still reject this.
> My opinion
> Det
Randall Schulz
Wed, 2009-06-17, 16:57
#16
Re: What version of schema2src works with what Scala version?
oops!
manney = manner
On Wed, Jun 17, 2009 at 4:41 PM, Kevin Wright <kev.lee.wright@googlemail.com> wrote:
manney = manner
On Wed, Jun 17, 2009 at 4:41 PM, Kevin Wright <kev.lee.wright@googlemail.com> wrote:
There are entire branches of mathematics now being explored that simply wouldn't be possible without increasingly powerful computers. Complexity, chaos, fractals, etc. Would anyone seriously suggest that we try and explore properties of the mandelbrot set doing calculations by hand?
Paramedics too have benefitted from tools, I'd defy anyone to find an ambulance that doesn't have a defibrilator available. Although I'd expect medics to know CPR, I'd be seriously worried if they didn't nevertheless use the tools that made them even more effective.
IDEs help us to deal with a codebase in whatever manney most closely fits the appropriate mental model, that and successive levels of abstraction are the real keys to improving productivity.
On Wed, Jun 17, 2009 at 4:32 PM, Detering Dirk <Dirk.Detering@bitmarck.de> wrote:> Do we want doctors to diagnose and treat based solely
> on what their unaided senses can tell them?
Well, this somewhat misses the point.
I at least do not want to die on the street
with a doctor passing by saying:
"Sorry, I would help you, but I can't do
any diagnosis without my hightech equipment
at hand ..."
Emergency medicine and paramedic education have
evolved too and should do that furthermore.
Having monthly more powerful computers today doesn't
mean that mathematicians shouldn't put time in
inventing better algorithms for calculations.
All in all, the tool shall not replace the improvement
of the basics.
My opinion
Det
Wed, 2009-06-17, 17:07
#17
Re: What version of schema2src works with what Scala version?
Randall R Schulz wrote:
> The original assertion I contested was this:
>
> On Wednesday June 17 2009, Martin S. Weber wrote:
>>> If a language requires an IDE and tool support for you to be
>>> productive in it, there's something wrong with the language.
>
> I still reject this.
I'm gonna highlight the important part again:
If a language *requires* an IDE and tool support for you to be productive in
it, there's something wrong with the language.
Why do we like scala? Because it's higher level than java. It makes you write
less code. The less code, the less "IDE support" you need. If we see some
pattern in the language whose solution we cannot code in scala itself but
instead have to either a) repeat it all over or b) have the IDE do it for us
(think, e.g. new collections library and their massive use of repeating
implicit and factories all over the place), then there's something not
high-level enough in the language and that ought to be fixed.
Or stated the other way round: if you have something in the language that
forces you to repeat yourself and you could either fix the language so you
don't have to repeat yourself OR improve IDE support for it so that the IDE
does the repeating part, what would be preferrable, would bring more benefit
to people? IMO that's clearly the first option. And if you opt for the latter,
then .. well .. there's something clearly wrong here.
-Martin
Wed, 2009-06-17, 17:07
#18
Re: What version of schema2src works with what Scala version?
On Wednesday June 17 2009, Martin S. Weber wrote:
> Randall R Schulz wrote:
> > The original assertion I contested was this:
> >
> > On Wednesday June 17 2009, Martin S. Weber wrote:
> >>> If a language requires an IDE and tool support for you to be
> >>> productive in it, there's something wrong with the language.
> >
> > I still reject this.
>
> I'm gonna highlight the important part again:
>
> If a language *requires* an IDE and tool support for you to be
> productive in it, there's something wrong with the language.
>
> Why do we like scala? Because it's higher level than java. It makes
> you write less code. The less code, the less "IDE support" you need.
I think this is exactly backward.
For just one example: You think that the programmer should be mentally
emulating the type inference algorithm so they can tell what a
particular symbol or expression means? I contend that the tool I use to
write code should be doing this for me and giving me the answer so I
don't need to.
Dense, concise, expressive languages require _more_ tool support, not
less.
> ...
>
> -Martin
Randall Schulz
Wed, 2009-06-17, 17:07
#19
Re: What version of schema2src works with what Scala version?
The choices are not mutually exclusive...
To give one of the more obvious examples, collections in scala import a LOT of methods from various traits, this allow you to think at a higher level when working with them.
on the other hand, collections in scala import a LOT of methods from various traits, this means that there is a lot more for developers to remember, especially if they are new to the language.
Support for code completion, browsing of class hierarchies, discovery of which trait provides a method, etc is pretty handy when working with a higher-level language that helps you not repeat yourself.
On Wed, Jun 17, 2009 at 4:57 PM, Martin S. Weber <martin.weber@nist.gov> wrote:
To give one of the more obvious examples, collections in scala import a LOT of methods from various traits, this allow you to think at a higher level when working with them.
on the other hand, collections in scala import a LOT of methods from various traits, this means that there is a lot more for developers to remember, especially if they are new to the language.
Support for code completion, browsing of class hierarchies, discovery of which trait provides a method, etc is pretty handy when working with a higher-level language that helps you not repeat yourself.
On Wed, Jun 17, 2009 at 4:57 PM, Martin S. Weber <martin.weber@nist.gov> wrote:
Randall R Schulz wrote:
The original assertion I contested was this:
On Wednesday June 17 2009, Martin S. Weber wrote:
If a language requires an IDE and tool support for you to be
productive in it, there's something wrong with the language.
I still reject this.
I'm gonna highlight the important part again:
If a language *requires* an IDE and tool support for you to be productive in it, there's something wrong with the language.
Why do we like scala? Because it's higher level than java. It makes you write less code. The less code, the less "IDE support" you need. If we see some pattern in the language whose solution we cannot code in scala itself but instead have to either a) repeat it all over or b) have the IDE do it for us (think, e.g. new collections library and their massive use of repeating implicit and factories all over the place), then there's something not high-level enough in the language and that ought to be fixed.
Or stated the other way round: if you have something in the language that forces you to repeat yourself and you could either fix the language so you don't have to repeat yourself OR improve IDE support for it so that the IDE does the repeating part, what would be preferrable, would bring more benefit to people? IMO that's clearly the first option. And if you opt for the latter, then .. well .. there's something clearly wrong here.
-Martin
Wed, 2009-06-17, 17:27
#20
Re: What version of schema2src works with what Scala version?
Randall R Schulz wrote:
> On Wednesday June 17 2009, Martin S. Weber wrote:
>> Randall R Schulz wrote:
>>> The original assertion I contested was this:
>>>
>>> On Wednesday June 17 2009, Martin S. Weber wrote:
>>>>> If a language requires an IDE and tool support for you to be
>>>>> productive in it, there's something wrong with the language.
>>> I still reject this.
>> I'm gonna highlight the important part again:
>>
>> If a language *requires* an IDE and tool support for you to be
>> productive in it, there's something wrong with the language.
>>
>> Why do we like scala? Because it's higher level than java. It makes
>> you write less code. The less code, the less "IDE support" you need.
>
> I think this is exactly backward.
>
> For just one example: You think that the programmer should be mentally
> emulating the type inference algorithm so they can tell what a
> particular symbol or expression means?
The _language_ is doing it for you. Of course you could have an IDE that
automatically overloads any single method you write for all possible
combinations of existing types which have similar methods etc. etc. That's IDE
support. Or you could have a higher level language that lets you write it once
and use it polymorph.
> I contend that the tool I use to
> write code should be doing this for me and giving me the answer so I
> don't need to.
Imo you're mixing IDE and the language here. If you don't comprehend the
language but need an IDE to explain it to you, you maybe shouldn't be using
that language in the first place...
> Dense, concise, expressive languages require _more_ tool support, not
> less.
I don't see how e.g. scheme will require more tool support than, say,
assembler. I might be a different-minded person than you are but I don't need
help from some tool to formulate scheme. I'd appreciate some help for
assembler though.
-Martin
Wed, 2009-06-17, 17:37
#21
Re: What version of schema2src works with what Scala version?
On Wednesday June 17 2009, Martin S. Weber wrote:
> Randall R Schulz wrote:
> > ...
> >
> > For just one example: You think that the programmer should be
> > mentally emulating the type inference algorithm so they can tell
> > what a particular symbol or expression means?
>
> The _language_ is doing it for you.
"The language" is a declarative thing. It has no behaviors. One has to
either write code (called a compiler) or performan mental calculations
to find answers to "what is the type associated with this symbol."
Clearly this is the sort of thing that is burdensome and error-prone
when done by a human.
> Of course you could have an IDE
> that automatically overloads any single method you write for all
> possible combinations of existing types which have similar methods
> etc. etc. That's IDE support. Or you could have a higher level
> language that lets you write it once and use it polymorph.
Again, this is a non-sequitur.
> > I contend that the tool I use to write code should be doing this for
> > me and giving me the answer so I don't need to.
>
> Imo you're mixing IDE and the language here. If you don't comprehend
> the language but need an IDE to explain it to you, you maybe
> shouldn't be using that language in the first place...
I think you're confusing the programmer and the compiler. If it were
practical for the programmer to do these things, we wouldn't need a
compiler.
> > Dense, concise, expressive languages require _more_ tool support,
> > not less.
>
> I don't see how e.g. scheme will require more tool support than, say,
> assembler. I might be a different-minded person than you are but I
> don't need help from some tool to formulate scheme. I'd appreciate
> some help for assembler though.
Scheme is the opposite of dense. It is syntactically minimal, e.g., and
where it is is complex (macros, e.g.), programmers have the most
trouble and need things like Dr. Scheme to help them understand what
they or other programmers have written.
> -Martin
Randall Schulz
Wed, 2009-06-17, 18:07
#22
Re: What version of schema2src works with what Scala version?
> If a language *requires* an IDE and tool support for you to be productive
> in
> it, there's something wrong with the language.
>
Absolute statements aren't engineering, they are religion. Is there
something wrong with a language that is designed such that programming with
an IDE is 20% more productive than without? 2x more productive? 10x more
productive? What if this productivity divergence comes not because the
language is an exceptionally poor fit for IDE-less programming (for example,
due to verbosity or ease of typo introduction) but is rather an
exceptionally good fit for programming with IDEs (perhaps due to highly
orthogonal language design enabling lots of automated refactorings, powerful
aspect-oriented features that make automated code searches exceptionally
handy).
I would say that Scala is actually a great example of a language whose
design enables powerful tooling to really shine in terms of increased
productivity. That tooling is just beginning to exist. When it does, I'd
be very surprised if Scala+IDE is less than 3x more productive than
Scala+Notepad. When that day comes, Scala+Notepad will effectively become
"unproductive", not because coding without an IDE has become more difficult,
but rather that the standards of what counts as "productive" will have
moved.
> Why do we like scala? Because it's higher level than java. It makes you
> write
> less code.
>
It makes you write less code per feature. In practice, that means (at least
for me), that I write exactly as much code per day as in Java. I just end
up with a lot more functionality. Assuming (as my employers seem to) that
there are an infinite number of features that can be desired, that's a win.
However, it means I need IDE support at least as much in Scala as Java, as
I'm continually doing searches|analyses|refactorings over large, dense,
feature-rich codebases. I'd no more try to do these by hand than I would
try to learn a new skill without using Google.
--Dave Griffith
Wed, 2009-06-17, 22:07
#23
Re: What version of schema2src works with what Scala version?
Robert,
i think Scala excels at being an awesome middle ground. It's really hard to get the same compression of code in Java as in Scala. That's one of the joys of a functional language. But, if you can get a huge leg up with a piece of open source based on a Java standard there's no reason not to use that. There are schemagen/jaxb maven plugins. i'm sure just get the XML into memory is only the beginning for your application and that there's probably quite a bit more logic/processing after that. That's where you can use Scala to better leverage. i strongly recommend you look at the Scala comprehension package for queries.
If you really want to be a purist or a masochist, the bar to meet here is CDuce. This is a variant branched from OCaml with embedded support for XML. There's also a backpatch of this capability to OCaml called OCamlDuce. Both of these solutions do what Scala + Schema2src should have done. From this perspective, you can either attempt to use one of these or you can view these as executable specifications of what the Scala ought to be doing and dig in and make it do this.
The trouble with using the OCaml-based soln's is that the OCaml world is miles from having the same level of open source libs and resources to use. Scala's interop with Java is seamless. Just make the jar file a dependency and call the code. It couldn't be easier. The trouble with upgrading Scala to do the desired thing here is ... do you have the time and the inclination. If your aim is to train yourself in Scala this might be just the ticket. If your aim is to build a solid application on time under budget, then the JAXB + Scala solution should really be given some serious consideration.
Best wishes,
--greg
On Wed, Jun 17, 2009 at 2:57 AM, Risch, Robert <robert.risch@philips.com> wrote:
i think Scala excels at being an awesome middle ground. It's really hard to get the same compression of code in Java as in Scala. That's one of the joys of a functional language. But, if you can get a huge leg up with a piece of open source based on a Java standard there's no reason not to use that. There are schemagen/jaxb maven plugins. i'm sure just get the XML into memory is only the beginning for your application and that there's probably quite a bit more logic/processing after that. That's where you can use Scala to better leverage. i strongly recommend you look at the Scala comprehension package for queries.
If you really want to be a purist or a masochist, the bar to meet here is CDuce. This is a variant branched from OCaml with embedded support for XML. There's also a backpatch of this capability to OCaml called OCamlDuce. Both of these solutions do what Scala + Schema2src should have done. From this perspective, you can either attempt to use one of these or you can view these as executable specifications of what the Scala ought to be doing and dig in and make it do this.
The trouble with using the OCaml-based soln's is that the OCaml world is miles from having the same level of open source libs and resources to use. Scala's interop with Java is seamless. Just make the jar file a dependency and call the code. It couldn't be easier. The trouble with upgrading Scala to do the desired thing here is ... do you have the time and the inclination. If your aim is to train yourself in Scala this might be just the ticket. If your aim is to build a solid application on time under budget, then the JAXB + Scala solution should really be given some serious consideration.
Best wishes,
--greg
On Wed, Jun 17, 2009 at 2:57 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hi Greg,
thank you for the tip.
However it was said that Scala is well suited for processing XML trees.
If the data binding is performed in the Java part I can also use
Java for the whole thing. Because of the better IDE and Tool support
of Java this is probably the fastes solution for the problem.
I will continue trying it with Scala because I want to train myself.
If I fail I will take a look into JAXB.
Bye
Robert
From: Meredith Gregory [mailto:lgreg.meredith@gmail.com]
Sent: Dienstag, 16. Juni 2009 13:44
To: Risch, Robert
Cc: Daniel Sobral; scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what Scala version?
Guys,
Is there any reason not to just use JAXB and then the Scala/Java interop?
Best wishes,
--gregOn Mon, Jun 15, 2009 at 8:47 AM, Risch, Robert <robert.risch@philips.com> wrote:
Is there an other tool to generate code from a DTD? Or where can I find example Scala code that
perform data binding with an xml file? My xml file is not very complex, so I can adapt the example.
The document ScalaByExample promise:
Pattern matching over class hierarchies unifies functional and objectoriented
data access. It greatly simplifies the processing of XML trees.
I have also checked scala.xml. This book recomment the schema2src tool.
But I don't want to code from scratch with java or use a DTD to java generator because I want to
learn a little bit Scala by solving the problem.
Bye
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 17:16
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what Scala version?
Then it looks like schema2src is out of date (for quite a while) with Scala.
On Mon, Jun 15, 2009 at 11:59 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hi Daniel,
I have checked it now ;-)
Unfortunaly that is not the reason for failure. After setting java -verbose:class I get this:
[Loaded schema2src.Main from file:/I:/scala-2.7.5.final/lib/schema2src.jar]
[Loaded scala.ScalaObject from I:\SCALA-~2.FIN\bin\..\lib\scala-library.jar]
So the classes are there.
I checked the BoxesUtility class and found a notice that it was deleted in svn during
cleanup for scala 2.7.0. With other version other classes are missing. Any idea?
Thanks
Robert
From: Daniel Sobral [mailto:dcsobral@gmail.com]
Sent: Montag, 15. Juni 2009 16:44
To: Risch, Robert
Cc: scala-user@listes.epfl.ch
Subject: Re: [scala-user] What version of schema2src works with what Scala version?
Do you have Scala's library in the CLASSPATH? Or SCALA_HOME set?
On Mon, Jun 15, 2009 at 9:48 AM, Risch, Robert <robert.risch@philips.com> wrote:
Hello everyone,
I am looking for a working combination of the schema2src tool and a Scala version.
I test with some Scala and schema2src versions:
After unpacking a Scala Version I add schema2src via "sbaz install schema2src" in this specific Scala version.
>\scala-2.7.5.final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxesUt
ility
at schema2src.Main$.processArgs(Main.scala:56)
>\scala-2.7.0-final\bin\schema2src dtd -d /tmp ComponentInfo.xsd out
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxedIn
t
at schema2src.Main$.processArgs(Main.scala:51)
I find that just before the Release of 2.7.0 BoxesUtility is deleted from Scala Lib.
So I try another version:
>\scala-2.6.1-final\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoSuchMethodError: scala.Seq$.unapplySeq(Ls
cala/Seq;)Lscala/Option;
at schema2src.Main$.processArgs(Main.scala:56)
I try also the lastest, nightly Scala version, but because there is no sbaz coming with it I copy Schema2src from 2.7.5.final to the last version:
>\scala-2.8.0.r18030-b20090615020147\bin\schema2src dtd ComponentInfo.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Seq
at schema2src.Main.main(Main.scala)
Now I get the latest source from schema2src via the Webbrowers of SVN
(http://lampsvn.epfl.ch/trac/scala/browser/scalax/trunk/schema2src/src/schema2src)
and put it into my eclipse IDE (with 2.7.5.final plugin installed).
This also don't work; it even don't compile.
Because I am new to Scala (I have only commercial know how in Objective-C; C++ and Java; not in Huskell and such things) I can not find
what is wrong with the code.
Main.scala: 38:
val mod = theModule.get(null).asInstanceOf[Module]
not found type Module
However there is a Module.scala alongside of Main.scala
xsd\GenSource.scala: 62:
return <moresource>
I encountered a '}' where I didn't expected one, maybe this tag isnn't closed <moresource>
And 5 another red dots indication a compile error.
My hope was that I get generated code to read my xml file and by using this code I can start learning Scala.
Bye
Robert
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
On Mon, Jun 15, 2009 at 9:48 AM, Risch, Robert <robert.risch@philips.com> wrote:
--
Daniel C. Sobral
Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value.