Parsing XML files in Noesis
Posted: Sat Jun 18, 2016 2:59 am
There's certain data for the models I am currently working on that is stored in XML files. I am using one of Python's provided XML parsers to handle them like this:
However, the code above causes Noesis to stop running the script, saying:
Now, to the best of my knowledge, Noesis includes the core libraries for parsing XML, so I am unsure why it's failing. I would really wish to avoid reinventing the wheel by parsing the XML files myself. Does anyone know what would be the best way to parse XML files inside Noesis scripts?
I'm using the latest version of Noesis (v4.177)
Code: Select all
import xml.etree.ElementTree as etree
#a few lines later:
tree = etree.parse(xmlFilePath)
root = tree.getroot()Code: Select all
Traceback (most recent call last):
File "C:\noesis\plugins\python\core321.zip\xml\etree\ElementTree.py", line 1488, in __init__
File "C:\noesis\plugins\python\core321.zip\xml\parsers\expat.py", line 6, in <module>
ImportError: No module named pyexpatI'm using the latest version of Noesis (v4.177)