| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
gTestfile = '13.5.4.5.js'; |
| 8 |
|
| 9 |
START("13.5.4.5 - XMLList children()"); |
| 10 |
|
| 11 |
TEST(1, true, XMLList.prototype.hasOwnProperty("children")); |
| 12 |
|
| 13 |
|
| 14 |
x = new XMLList() |
| 15 |
TEST(2, "xml", typeof(x.children())); |
| 16 |
TEST_XML(3, "", x.children()); |
| 17 |
|
| 18 |
|
| 19 |
x += <alpha>one<bravo>two</bravo></alpha>; |
| 20 |
TEST(4, "xml", typeof(x.children())); |
| 21 |
|
| 22 |
correct = <>one<bravo>two</bravo></>; |
| 23 |
TEST(5, correct, x.children()); |
| 24 |
|
| 25 |
|
| 26 |
x += <charlie><bravo>three</bravo></charlie>; |
| 27 |
TEST(6, "xml", typeof(x.children())); |
| 28 |
|
| 29 |
correct = <>one<bravo>two</bravo><bravo>three</bravo></>; |
| 30 |
TEST(7, correct, x.children()); |
| 31 |
|
| 32 |
|
| 33 |
x = new XMLList(); |
| 34 |
x += <alpha></alpha>; |
| 35 |
x += <bravo></bravo>; |
| 36 |
TEST(8, "xml", typeof(x.children())); |
| 37 |
TEST_XML(9, "", x.children()); |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
order = |
| 42 |
<order> |
| 43 |
<customer> |
| 44 |
<name>John Smith</name> |
| 45 |
</customer> |
| 46 |
<item id="1"> |
| 47 |
<description>Big Screen Television</description> |
| 48 |
<price>1299.99</price> |
| 49 |
</item> |
| 50 |
<item id="2"> |
| 51 |
<description>DVD Player</description> |
| 52 |
<price>399.99</price> |
| 53 |
</item> |
| 54 |
</order>; |
| 55 |
|
| 56 |
correct= <price>1299.99</price> + <price>399.99</price>; |
| 57 |
|
| 58 |
TEST(10, correct, order.children().price); |
| 59 |
|
| 60 |
END(); |