summaryrefslogtreecommitdiff
path: root/test/files/xml/xhtml.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/xml/xhtml.scala')
-rw-r--r--test/files/xml/xhtml.scala33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/files/xml/xhtml.scala b/test/files/xml/xhtml.scala
new file mode 100644
index 0000000000..e1510456c7
--- /dev/null
+++ b/test/files/xml/xhtml.scala
@@ -0,0 +1,33 @@
+// $Id$
+
+import scala.xml.{Node,Text};
+import dtd._;
+
+object Test {
+
+ val n = Node.NoAttributes;
+
+ def main( argv:Array[String] ) = {
+ val link = A( n + "href" -> "http://lampwww.epfl.ch",
+ Text("link"));
+
+ //val m = new scala.collection.mutable.HashMap[String, String];
+ //m.put("href","http://lampwww.epfl.ch");
+ //link.setAttribs(m);
+
+ val body = Body(n,
+ H1(n,Text("Welcome to xhtml in scala")),
+ P(n,Text( "a paragraph")),
+ P(n,Text("another one, with a "),link,Text(" to the LAMP homepage.")));
+ val page = Html(n,
+ Head(n,
+ Base(n+"href" -> "http://here.edu"),
+ Title(n,Text("a basic xhtml page"))),
+ body);
+ System.out.println( page ) ;
+
+ val doc = load(argv(0));
+ System.out.println( doc );
+ }
+
+}