2 import flash.display.MovieClip
3 public class Main extends flash.display.MovieClip {
6 function assert(b:Boolean) {
8 trace("ok "+count+"/"+num);
10 trace("error "+count+"/"+num);
16 <tests xmlns:test1="http://www.quiss.org/test1/"
17 xmlns:test2="http://www.quiss.org/test2/"
18 xmlns:test3="http://www.quiss.org/test3/">
19 <test1:test>P1</test1:test>
20 <test2:test>P2</test2:test>
21 <test3:test a="b">P3</test3:test>
24 var top:Namespace = x.namespace();
25 var ns1:Namespace = x.namespace("test1");
26 var ns2:Namespace = x.namespace("test2");
27 var ns3:Namespace = x.namespace("test3");
28 assert(ns1 == new Namespace("http://www.quiss.org/test1/"));
29 assert(ns2 == new Namespace("http://www.quiss.org/test2/"));
30 assert(x.ns1::test == "P1");
31 assert(x.ns2::test == "P2");
33 assert(x.ns1::* == "P1")
35 default xml namespace = ns2;
36 assert(x.test == "P2")
38 assert(x.*::* == (x.ns1::*+x.ns2::*+x.ns3::*))
39 //attribute with a namespace:
40 assert(x..@*::* == "b");
42 x.ns2::test = x.ns3::test;
43 assert(x..@a.toString() == "bb");