diff options
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 } } |