| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
gTestfile = '13.4.4.33.js'; |
| 8 |
|
| 9 |
START("13.4.4.33 - XML setChildren()"); |
| 10 |
|
| 11 |
TEST(1, true, XML.prototype.hasOwnProperty("setChildren")); |
| 12 |
|
| 13 |
x = |
| 14 |
<alpha> |
| 15 |
<bravo>one</bravo> |
| 16 |
</alpha>; |
| 17 |
|
| 18 |
correct = |
| 19 |
<alpha> |
| 20 |
<charlie>two</charlie> |
| 21 |
</alpha>; |
| 22 |
|
| 23 |
x.setChildren(<charlie>two</charlie>); |
| 24 |
|
| 25 |
TEST(2, correct, x); |
| 26 |
|
| 27 |
|
| 28 |
emps = |
| 29 |
<employees> |
| 30 |
<employee id="0"><name>Jim</name><age>25</age></employee> |
| 31 |
<employee id="1"><name>Joe</name><age>20</age></employee> |
| 32 |
</employees>; |
| 33 |
|
| 34 |
correct = |
| 35 |
<employees> |
| 36 |
<employee id="0"><name>John</name><age>35</age></employee> |
| 37 |
<employee id="1"><name>Joe</name><age>20</age></employee> |
| 38 |
</employees>; |
| 39 |
|
| 40 |
emps.employee.(name == "Jim").setChildren(<name>John</name> + <age>35</age>); |
| 41 |
|
| 42 |
TEST(3, correct, emps); |
| 43 |
|
| 44 |
END(); |