# XML DOM Parser error

**URL:** <https://forum.inductiveautomation.com/t/xml-dom-parser-error/91032>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 28, 2024, 7:34pm UTC](https://forum.inductiveautomation.com/t/xml-dom-parser-error/91032 "2024-05-28T19:34:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [May 28, 2024, 7:34pm UTC](https://forum.inductiveautomation.com/t/xml-dom-parser-error/91032/1 "2024-05-28T19:34:27Z")

</div>

When I execute the "A Simple Employee Example" script shown in [Parsing XML with Java Libraries | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/platform/scripting/scripting-examples/parsing-xml-with-the-etree-library)

...I get the error:

```python
'com.sun.org.apache.xerces.internal.dom.DeepNodeListImpl' object is not iterable

```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 30, 2024, 10:53am UTC](https://forum.inductiveautomation.com/t/xml-dom-parser-error/91032/2 "2024-05-30T10:53:45Z")

</div>

Yeah, I don't know if the DOM libraries have changes since that was written, but this loop seems to work for the sample:

```python
for i in range(employees.getLength()):
    employee = employees.item(i)
    # Convert the id attribute to an integer
    id = int(employee.getAttribute("id"))
    print("Employee ID:", id)
    print("Name:", employee.getElementsByTagName("name").item(0).nodeValue)
    print("Department:", employee.getElementsByTagName("department").item(0).nodeValue)
    print()

```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 30, 2024, 11:04am UTC](https://forum.inductiveautomation.com/t/xml-dom-parser-error/91032/3 "2024-05-30T11:04:10Z")

</div>

Looking at the examples, the only on that seems to work without modification is the StAX parser at the bottom of the page.

Pinging @Paul.Scott
