diff options
Diffstat (limited to 'test/files/jvm/xmlstuff.scala')
-rw-r--r-- | test/files/jvm/xmlstuff.scala | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/test/files/jvm/xmlstuff.scala b/test/files/jvm/xmlstuff.scala index f2ad0307b1..45234c7139 100644 --- a/test/files/jvm/xmlstuff.scala +++ b/test/files/jvm/xmlstuff.scala @@ -26,7 +26,7 @@ object Test { <baz bazValue="8"/> <bar value="5" gi='go'/> </foo>; - + val pelems_1 = for (x <- p \ "bar"; y <- p \ "baz" ) yield { Text(x.attributes("value").toString + y.attributes("bazValue").toString+ "!") }; @@ -35,14 +35,14 @@ object Test { assert(Text("8") sameElements (p \\ "@bazValue")) - val books = + val books = <bks> <book><title>Blabla</title></book> <book><title>Blubabla</title></book> <book><title>Baaaaaaalabla</title></book> </bks>; - val reviews = + val reviews = <reviews> <entry><title>Blabla</title> <remarks> @@ -72,32 +72,32 @@ object Test { )); // example - println( + println( for (t @ <book><title>Blabla</title></book> <- new NodeSeq { val theSeq = books.child }.toList) yield t ); - val phoneBook = + val phoneBook = <phonebook> <descr> - This is the <b>phonebook</b> of the + This is the <b>phonebook</b> of the <a href="http://acme.org">ACME</a> corporation. </descr> <entry> - <name>John</name> + <name>John</name> <phone where="work"> +41 21 693 68 67</phone> <phone where="mobile">+41 79 602 23 23</phone> </entry> </phonebook>; - val addrBook = + val addrBook = <addrbook> <descr> - This is the <b>addressbook</b> of the + This is the <b>addressbook</b> of the <a href="http://acme.org">ACME</a> corporation. </descr> <entry> - <name>John</name> + <name>John</name> <street> Elm Street</street> <city>Dolphin City</city> </entry> @@ -113,7 +113,7 @@ object Test { </result> )); - + /* namespaces */ // begin tmp println("namespaces") @@ -135,9 +135,9 @@ object Test { import scala.xml.dtd.ELEMENTS import scala.xml.dtd.ContentModel._ vtor.setContentModel( - ELEMENTS( + ELEMENTS( Sequ( - Letter(ElemName("bar")), + Letter(ElemName("bar")), Star(Letter(ElemName("baz"))) ))); } @@ -146,11 +146,11 @@ object Test { { import scala.xml.dtd.MIXED import scala.xml.dtd.ContentModel._ - + vtor.setContentModel( MIXED( - Alt(Letter(ElemName("bar")), - Letter(ElemName("baz")), + Alt(Letter(ElemName("bar")), + Letter(ElemName("baz")), Letter(ElemName("bal"))))); } @@ -162,20 +162,20 @@ object Test { vtor.setContentModel(null) vtor.setMetaData(List()) assert(!vtor( <foo bar="hello"/> )) - - { - import scala.xml.dtd._ + + { + import scala.xml.dtd._ vtor setMetaData List(AttrDecl("bar", "CDATA", IMPLIED)) } assert(!vtor(<foo href="http://foo.com" bar="hello"/>)) assert(vtor(<foo bar="hello"/>)) - { + { import scala.xml.dtd._ vtor.setMetaData(List(AttrDecl("bar","CDATA",REQUIRED))) } assert(!vtor( <foo href="http://foo.com" /> )) assert( vtor( <foo bar="http://foo.com" /> )) - + } } |