diff options
-rw-r--r-- | test/files/jvm/xmlstuff.check | 7 | ||||
-rw-r--r-- | test/files/jvm/xmlstuff.scala | 38 |
2 files changed, 45 insertions, 0 deletions
diff --git a/test/files/jvm/xmlstuff.check b/test/files/jvm/xmlstuff.check index f8bab77aac..b348451a28 100644 --- a/test/files/jvm/xmlstuff.check +++ b/test/files/jvm/xmlstuff.check @@ -31,3 +31,10 @@ passed ok <remarks>rem 2</remarks> </result> List(<book><title>Blabla</title></book>) +<result> + <name>John</name> + <street>Elm Street</street> + <city>Dolphin City</city> + <phone where="work">+41 21 693 68 67</phone> + <phone where="mobile">+41 79 602 23 23</phone> +</result> diff --git a/test/files/jvm/xmlstuff.scala b/test/files/jvm/xmlstuff.scala index 09bfcd084b..bf08aa348e 100644 --- a/test/files/jvm/xmlstuff.scala +++ b/test/files/jvm/xmlstuff.scala @@ -237,4 +237,42 @@ object Test with Application { yield t ); +val phoneBook = + <phonebook> + <descr> + This is the <b>phonebook</b> of the + <a href="http://acme.org">ACME</a> corporation. + </descr> + <entry> + <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 = + <addrbook> + <descr> + This is the <b>addressbook</b> of the + <a href="http://acme.org">ACME</a> corporation. + </descr> + <entry> + <name>John</name> + <street> Elm Street</street> + <city>Dolphin City</city> + </entry> + </addrbook>; + + Console.println( new scala.xml.PrettyPrinter(80, 5).format ( + for( val t <- addrBook \\ "entry"; + val r <- phoneBook \\ "entry"; + t \ "name" == r \ "name") yield + <result> + { t.child } + { r \ "phone" } + </result> + )); + + } |