diff options
author | buraq <buraq@epfl.ch> | 2004-05-26 10:51:31 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2004-05-26 10:51:31 +0000 |
commit | c3168553c4b023ef75210185e4654ea84e16682e (patch) | |
tree | 28d01e1db01795e1f765b4d40aa93ebb99e95d71 | |
parent | 5e5ff4d592a37621471ee96e99ebca51587b2e89 (diff) | |
download | scala-c3168553c4b023ef75210185e4654ea84e16682e.tar.gz scala-c3168553c4b023ef75210185e4654ea84e16682e.tar.bz2 scala-c3168553c4b023ef75210185e4654ea84e16682e.zip |
java.io
-rw-r--r-- | sources/scala/xml/FactoryAdapter.scala | 9 | ||||
-rw-r--r-- | sources/scala/xml/nobinding/XML.scala | 27 |
2 files changed, 10 insertions, 26 deletions
diff --git a/sources/scala/xml/FactoryAdapter.scala b/sources/scala/xml/FactoryAdapter.scala index c33299f03f..a0837cff55 100644 --- a/sources/scala/xml/FactoryAdapter.scala +++ b/sources/scala/xml/FactoryAdapter.scala @@ -8,8 +8,7 @@ \* */ package scala.xml ; -import java.io.{OutputStream,OutputStreamWriter,PrintWriter,Writer}; -import java.io.UnsupportedEncodingException; +import java.io._ ; import scala.collection.mutable.{HashMap,Stack}; import org.xml.sax.Attributes; @@ -336,17 +335,17 @@ abstract class FactoryAdapter /** loads XML from given file */ def loadFile( file:File ):Node = loadXML( new InputSource( - FileInputStream( file ) + new FileInputStream( file ) )); /** loads XML from given file descriptor */ def loadFile( fileDesc:FileDescriptor ):Node = loadXML( new InputSource( - FileInputStream( fileDesc ) + new FileInputStream( fileDesc ) )); /** loads XML from given file */ def loadFile( fileName:String ):Node = loadXML( new InputSource( - FileInputStream( fileName ) + new FileInputStream( fileName ) )); /** loads XML from given InputStream */ diff --git a/sources/scala/xml/nobinding/XML.scala b/sources/scala/xml/nobinding/XML.scala index b7bbc274b4..1ccb31dc5e 100644 --- a/sources/scala/xml/nobinding/XML.scala +++ b/sources/scala/xml/nobinding/XML.scala @@ -9,7 +9,6 @@ package scala.xml.nobinding ; import org.xml.sax.InputSource; - import scala.collection.Map ; import scala.collection.mutable.HashMap ; @@ -18,26 +17,28 @@ import scala.xml.Utility ; /** functions to load and save XML elements. use this when data binding is not ** desired, i.e. when XML is handled using Symbol nodes **/ -object XML with Function1[InputStream,Elem] with Function1[String,Elem] with Function1[Reader,Elem] with Function1[InputSource,Elem] { +object XML { + + import java.io._ ; // functions for generic xml loading, saving /** loads XML from given file */ def loadFile( file:File ):scala.xml.Elem = new NoBindingFactoryAdapter().loadXML( new InputSource( - FileInputStream( file ) + new FileInputStream( file ) )); /** loads XML from given file descriptor */ def loadFile( fileDesc:FileDescriptor ):scala.xml.Elem = new NoBindingFactoryAdapter().loadXML( new InputSource( - FileInputStream( fileDesc ) + new FileInputStream( fileDesc ) )); /** loads XML from given file */ def loadFile( fileName:String ):scala.xml.Elem = new NoBindingFactoryAdapter().loadXML( new InputSource( - FileInputStream( fileName ) + new FileInputStream( fileName ) )); /** loads XML from given InputStream */ @@ -72,20 +73,4 @@ object XML with Function1[InputStream,Elem] with Function1[String,Elem] with Fun fos.close(); } - /** loads XML from given InputStream */ - def apply( is:InputStream ):scala.xml.Elem = - new NoBindingFactoryAdapter().loadXML( new InputSource( is )); - - /** loads XML from given Reader */ - def apply( reader:Reader ):scala.xml.Elem = - new NoBindingFactoryAdapter().loadXML( new InputSource( reader )); - - /** loads XML from given sysID */ - def apply( sysID:String ):scala.xml.Elem = - new NoBindingFactoryAdapter().loadXML( new InputSource( sysID )); - - /** loads XML from a given input source*/ - def apply( source:InputSource ):scala.xml.Elem = - new NoBindingFactoryAdapter().loadXML( source ); - } |