diff options
author | michelou <michelou@epfl.ch> | 2008-01-29 12:06:30 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2008-01-29 12:06:30 +0000 |
commit | ca644940538c86aca051d38a18a630028a76c4fc (patch) | |
tree | 62644cad5845c9bd512c64020cb36ba60cd8bf51 /test/files | |
parent | d855e454426fb782730542f84c01f3bfd9d50f7d (diff) | |
download | scala-ca644940538c86aca051d38a18a630028a76c4fc.tar.gz scala-ca644940538c86aca051d38a18a630028a76c4fc.tar.bz2 scala-ca644940538c86aca051d38a18a630028a76c4fc.zip |
fixed missing merge in r13827
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/jvm/xml03syntax.scala | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/test/files/jvm/xml03syntax.scala b/test/files/jvm/xml03syntax.scala index 9c1cee19e1..7e49ee7b7e 100644 --- a/test/files/jvm/xml03syntax.scala +++ b/test/files/jvm/xml03syntax.scala @@ -11,6 +11,7 @@ object Test extends AnyRef with Assert { def main(args: Array[String]) { test1 test2 + test3 } private def test1 { @@ -64,6 +65,20 @@ object Test extends AnyRef with Assert { println } + /** see SVN r13821 (emir): support for <elem key={x:Option[Seq[Node]]} />, + * so that Options can be used for optional attributes. + */ + private def test2 { + val x1: Option[Seq[Node]] = Some(<b>hello</b>) + val n1 = <elem key={x1} />; + println("node="+n1+", key="+n1.attribute("key")) + + val x2: Option[Seq[Node]] = None + val n2 = <elem key={x2} />; + println("node="+n2+", key="+n2.attribute("key")) + } + + private def test3 { // this demonstrates how to handle entities val s = io.Source.fromString("<a> </a>") object parser extends xml.parsing.ConstructingParser(s, false /*ignore ws*/) { @@ -78,19 +93,6 @@ object Test extends AnyRef with Assert { val parsed = parser.element(TopScope) // parse the source as element // alternatively, we could call document() parsed - - /** see SVN r13821 (emir): support for <elem key={x:Option[Seq[Node]]} />, - * so that Options can be used for optional attributes. - */ - private def test2 { - val x1: Option[Seq[Node]] = Some(<b>hello</b>) - val n1 = <elem key={x1} />; - println("node="+n1+", key="+n1.attribute("key")) - - val x2: Option[Seq[Node]] = None - val n2 = <elem key={x2} />; - println("node="+n2+", key="+n2.attribute("key")) ->>>>>>> .r13822 } } |