diff options
author | Lex Spoon <lex@lexspoon.org> | 2006-04-27 09:08:11 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2006-04-27 09:08:11 +0000 |
commit | dab0d42953f2d56d5d63b45f9b43029b7b41ff39 (patch) | |
tree | 0f6bb6f45f6df88dac1ac6b3dd7375ee8337dbdc | |
parent | a9595d49f79854bf92ef692c2d22888522b433fd (diff) | |
download | scala-dab0d42953f2d56d5d63b45f9b43029b7b41ff39.tar.gz scala-dab0d42953f2d56d5d63b45f9b43029b7b41ff39.tar.bz2 scala-dab0d42953f2d56d5d63b45f9b43029b7b41ff39.zip |
added loadString
-rw-r--r-- | src/library/scala/xml/XML.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library/scala/xml/XML.scala b/src/library/scala/xml/XML.scala index 9ca2943440..37e043afbc 100644 --- a/src/library/scala/xml/XML.scala +++ b/src/library/scala/xml/XML.scala @@ -61,10 +61,14 @@ object XML { final def load( sysID:String ): scala.xml.Elem = new NoBindingFactoryAdapter().loadXML( new InputSource( sysID )); - /** loads XML from a given input source*/ + /** loads XML from a given input source */ final def load( source:InputSource ): scala.xml.Elem = new NoBindingFactoryAdapter().loadXML( source ); + /** loads XML from a string */ + final def loadString( string:String ): scala.xml.Elem = + load(new StringReader(string)) + /** saves XML to filename with encoding ISO-8859-1 */ final def save( filename:String, doc:Elem ):Unit = { /* using NIO classes of JDK 1.4 */ |