Parsing XML with Rhino Python issues

Hi All,

I am writing a script that runs in rhino and opens an xml file. I am using the instructions from IronPython’s documentation. However, I keep getting an error that looks like it relates to the libraries.

import rhinoscriptsyntax as rs
from xml.etree.ElementTree import ElementTree

def SortByName():
#load the xml file
tree = ElementTree()

Message: No module named expat; use SimpleXMLTreeBuilder instead

line 1445, in init, "c:\Program Files\Rhinoceros 5 (64-bit)\Plug-ins\IronPython\Lib\xml\etree\"
line 648, in parse, "c:\Program Files\Rhinoceros 5 (64-bit)\Plug-ins\IronPython\Lib\xml\etree\"
line 7, in SortByName, "C:\Users\jikatz\Desktop\"
line 25, in , “C:\Users\jikatz\Desktop\

Any help you can give me would be greatly appreciated.

Hi Joshua,

you might try to use System.Xml instead as described here for reading and saving xml files.