1 // makeswf -v 7 -r 1 -o xml-node-7.swf xml-node.as
5 // Test XML issues that are not handled by the other tests
7 function test_constructor
()
10 trace
(new XML ("<root/>"));
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
()
29 <!DOCTYPE doctype decl>
31 text <!-- comment --> more text
32 <child_element attribute='value'/>
38 for (var i
= 0; i
< values
.length
; i
++) {
39 trace
("Constructing with: " + names
[i
]);
40 trace
(x
.parseXML
(values
[i
]));
45 function test_create
()
47 var x
= new XML ("<root/>");
51 trace
(x
.createElement
("name"));
53 trace
(x
.createTextNode
("value"));
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
()
72 var x
= new XML ("<?xml XML declaration ?><!DOCTYPE doctype declaration ><root/>");
73 trace
(x
.contentType
);
74 trace
(x
.docTypeDecl
);
75 trace
(x
.ignoreWhite
);
79 x
= new XML ("<root/>");
80 trace
(x
.contentType
);
81 trace
(x
.docTypeDecl
);
82 trace
(x
.ignoreWhite
);
87 trace
(x
.contentType
);
88 trace
(x
.docTypeDecl
);
89 trace
(x
.ignoreWhite
);
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
];
105 x
.status
= values
[i
];
107 x
.xmlDecl
= values
[i
];
117 loadMovie
("FSCommand:quit", "");