GIGO: words unreadable aloud
Mishrogo Weedapeval
 

 

  Saturday 14 February 2004
Scala loading XML files

I worked through the XML example in the scala intro pages, at http://scala.epfl.ch/intro/xml.html . I ran scala teamtest > ttout.xml and then the following code can load that xml file:

/*
 * Try "load"ing one of these babies.
 *     scalac teamload.scala teamlist.scala
 *     scala teamload
 */
import teamlist._ ;     // import generated definitions
import scala.xml.Text ; // for creating PCDATA nodes
object teamload with Application {
  val fn = "ttout.xml" ;
  val top = teamlist.load( fn );
  Console.println( "Original, from " + fn );
  Console.println( top );
}

Next up: experiments with the regular expression patterns described here: http://scala.epfl.ch/intro/regexppat.html

Of the recent additions to the language, those strike me (without any experience yet) as the weirdest new feature.
12:31:52 AM   comment/     



Click here to visit the Radio UserLand website. Click to see the XML version of this web page. © Copyright 2007 Doug Landauer .
Last update: 07/2/6; 12:37:11 .
Click here to send an email to the editor of this weblog.

February 2004
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29            
Jan   Mar

Previous/Next