summaryrefslogtreecommitdiff
path: root/test/files/run/xmlParsing.scala
blob: d602d9e0bc0b7d4fe61ded80da5f7aaf319e9aac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//############################################################################
// XML Parsing
//############################################################################
// $Id$

import scala.testing.UnitTest._ ;

import scala.xml._ ;

/** this file test just succesful run of the parser. There are no checks whether
 *  the encoding to Scala expressions is done correctly
 */
object Test with Application {

  val x0  = <hello/>;
  val x1s = <foo></foo>.toString();
  val x2 = <foo><bar><baz/></bar><bar/></foo>.toString();

  /* whitespace (ws) handling */

  val x3 = <hello  >  </hello>.toString();       /* ws in tags allowed */

  val x4 = <hello>
             <world></world>
             <test/>
             <mars></mars></hello>.toString();   /* ws in element content */

  /* attributes */

  val z = <html>
            <body background="#FFFFFF">
              <h1>Hello World</h1>
              <p>Check the <a href="scala.epfl.ch">scala</a> page!</p>
            </body>
          </html>.toString();

  val ent = <foo>
                 hello   &nbsp; character entities!
                 welcome &#0160; unicode characters!
            </foo>

}