| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
gTestfile = '13.4.4.4.js'; |
| 8 |
|
| 9 |
START("13.4.4.4 - XML attribute()"); |
| 10 |
|
| 11 |
TEST(1, true, XML.prototype.hasOwnProperty("attribute")); |
| 12 |
|
| 13 |
|
| 14 |
emps = |
| 15 |
<employees count="2"> |
| 16 |
<employee id="0"><name>Jim</name><age>25</age></employee> |
| 17 |
<employee id="1"><name>Joe</name><age>20</age></employee> |
| 18 |
</employees>; |
| 19 |
|
| 20 |
TEST_XML(2, 2, emps.attribute("count")); |
| 21 |
|
| 22 |
|
| 23 |
emps = |
| 24 |
<employees> |
| 25 |
<employee id="0"><name>Jim</name><age>25</age></employee> |
| 26 |
<employee id="1"><name>Joe</name><age>20</age></employee> |
| 27 |
</employees>; |
| 28 |
|
| 29 |
TEST_XML(3, 0, emps.employee.(age == "25").attribute("id")); |
| 30 |
|
| 31 |
|
| 32 |
emps = |
| 33 |
<employees> |
| 34 |
<employee id="0"><name>Jim</name><age>25</age></employee> |
| 35 |
<employee id="1"><name>Joe</name><age>20</age></employee> |
| 36 |
</employees>; |
| 37 |
|
| 38 |
TEST_XML(4, 0, emps.employee.(name == "Jim").attribute("id")); |
| 39 |
|
| 40 |
END(); |