In many cases an XML element has multiple children with the same name. For example, the example document used in this chapter has multiple name elements in the employee elements. In many cases, you can treat the child elements with identical names as an array. For example, to reference the second name element in mydoc.employee, you can specify mydoc.employee.name[2]. However, you can only use a limited set of Array functions when you use this notation. The following table lists the array functions that are valid for such references:
Array function | Result |
---|---|
|
Always returns False. |
|
Removes all the elements with name |
|
Returns the number of elements named |
|
Deletes the |
|
Always returns |
|
Returns a comma separated list of all the |