summaryrefslogtreecommitdiff
path: root/test/files/jvm/xmlstuff.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/jvm/xmlstuff.scala')
-rw-r--r--test/files/jvm/xmlstuff.scala38
1 files changed, 38 insertions, 0 deletions
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>
+ ));
+
+
}