remove "*&val" references
[swfdec.git] / test / trace / xml-other.as
blobe75c8f746376997186a6220ebe2f004dcb3941f6
1 // makeswf -v 7 -r 1 -o xml-node-7.swf xml-node.as
3 #include "values.as"
5 // Test XML issues that are not handled by the other tests
7 function test_constructor ()
9 // normal
10 trace (new XML ("<root/>"));
11 trace (new XML ());
13 // weird parameters
14 trace (new XML ("<root/>", "<more>stuff</more>"));
16 for (var i = 0; i < values.length; i++) {
17 trace ("Constructing with: " + names[i]);
18 trace (new XML (values[i]));
22 function test_parse ()
24 var x = new XML ();
26 // normal
27 trace (x.parseXML ("
28 <?xml XML decl ?>
29 <!DOCTYPE doctype decl>
30 <element>
31 text <!-- comment --> more text
32 <child_element attribute='value'/>
33 </element>
34 "));
35 trace (x);
37 // weird parameters
38 for (var i = 0; i < values.length; i++) {
39 trace ("Constructing with: " + names[i]);
40 trace (x.parseXML (values[i]));
41 trace (x);
45 function test_create ()
47 var x = new XML ("<root/>");
49 // normal
50 trace (x);
51 trace (x.createElement ("name"));
52 trace (x);
53 trace (x.createTextNode ("value"));
54 trace (x);
56 // weird parameters
57 trace (x.createElement ());
58 trace (x.createTextNode ());
59 trace (x.createElement ("name", "name2"));
60 trace (x.createTextNode ("value", "value2"));
62 for (var i = 0; i < values.length; i++) {
63 trace ("Creating with: " + names[i]);
64 trace (x.createElement (values[i]));
65 trace (x.createTextNode (values[i]));
69 function test_properties ()
71 // normal
72 var x = new XML ("<?xml XML declaration ?><!DOCTYPE doctype declaration ><root/>");
73 trace (x.contentType);
74 trace (x.docTypeDecl);
75 trace (x.ignoreWhite);
76 trace (x.loaded);
77 trace (x.status);
78 trace (x.xmlDecl);
79 x = new XML ("<root/>");
80 trace (x.contentType);
81 trace (x.docTypeDecl);
82 trace (x.ignoreWhite);
83 trace (x.loaded);
84 trace (x.status);
85 trace (x.xmlDecl);
86 x = new XML ();
87 trace (x.contentType);
88 trace (x.docTypeDecl);
89 trace (x.ignoreWhite);
90 trace (x.loaded);
91 trace (x.status);
92 trace (x.xmlDecl);
94 // write
95 for (var i = 0; i < values.length; i++) {
96 trace ("Testing with: " + names[i]);
97 x.contentType = values[i];
98 trace (x.contentType);
99 x.docTypeDecl = values[i];
100 trace (x.docTypeDecl);
101 x.ignoreWhite = values[i];
102 trace (x.ignoreWhite);
103 x.loaded = values[i];
104 trace (x.loaded);
105 x.status = values[i];
106 trace (x.status);
107 x.xmlDecl = values[i];
108 trace (x.xmlDecl);
112 test_constructor ();
113 test_parse ();
114 test_create ();
115 test_properties ();
117 loadMovie ("FSCommand:quit", "");