# Simple xml parsing question

**URL:** <https://forum.inductiveautomation.com/t/simple-xml-parsing-question/89232>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [April 22, 2024, 7:17pm UTC](https://forum.inductiveautomation.com/t/simple-xml-parsing-question/89232 "2024-04-22T19:17:05Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 22, 2024, 7:27pm UTC](https://forum.inductiveautomation.com/t/simple-xml-parsing-question/89232/4 "2024-04-22T19:27:00Z")

</div>

Related:

> [@Download file as xml](https://forum.inductiveautomation.com/t/download-file-as-xml/84363/2):
>
> Good morning Gerardo, Yes, but you'll have to generate the XML piece by piece. I would use my helper script module for this kind of work: [xml.py](https://www.automation-pros.com/ignition/xml.py) (Place it in your project script library.) Make a somewhat generic row-to-xml function in a project library, perhaps like so: rowTemplate = """\<table\>\<row/\>\</table\>""" # Produce downloadable XML bytes from a dictionary of column values. def rowToXML(valuesDict): dom = xml.strToDoc(rowTemplate) rowNode = dom.getElementsByTagName("row")[0] for k, …

I highly recommend using my wrappers around java's native XML handlers.

Edit: This might be more helpful:

> [@New conversion from python parsing to Java](https://forum.inductiveautomation.com/t/new-conversion-from-python-parsing-to-java/49202):
>
> Here is the current block of code where I am using the parse with jython solution that tends to lock up every so often. import xml.etree.ElementTree as ET #read the xml filef for device in importDevices: filePath = '%s/%s.xml' % (rootPath,device) #print 'reading %s' % filePath deviceStart = system.date.now() #logger.info('Before: tree = ET.parse(filePath)') tree = ET.parse(filePath) #logger.info('After: tree = ET.parse(filePath)') xmlFile = tree.getroot() I made the f…

---

_[View the full topic](https://forum.inductiveautomation.com/t/simple-xml-parsing-question/89232)._
