from xml.etree import ElementTree # part of python distribution
from elementtree import SimpleXMLTreeBuilder # part of your codebase
ElementTree.XMLTreeBuilder = SimpleXMLTreeBuilder.TreeBuilder
with this error:
Solution exception:No module named elementtree
gHowl has an xml parser to obtain the info, challenge is breaking it up into usable formats.
Wrote ths with y being the xml file path:
filename = y
xmldoc = System.Xml.XmlDocument()
xmldoc.Load(filename)
items = xmldoc.SelectNodes(“liftbridges/mile/”)
for item in items:
print item.InnerText
I had a similar problem with Ironpython in Rhino 5. As I remember I ended up doing my xml parsing with a separate CPython script before importing the results into the Elk plugin.
This means that a DataTree[object] (a type that is very specific to the Grasshopper SDK) was fed to a library that only accepts str (strings) in that place.
Maybe there is a way to make this work: could you attach a small definition with something to test?
This works fine with both libraries in Rhino 6. Each can be used, and one is more “.Net”-y, and the other is more “classic Python”. Other than this, I don’t see any problem with any of them, and they give the same results.