Read XML files

Hi all,
I wonder if it’s possible to use an XML file to store data and read it with RhinoScript similar to the way it works with ini files?

thanks, Tobias

@tobias,

yes this works if you import System.Xml. Examples to read can be found in this and this thread.

c.

Hi Clement,
Yeah, in Python it’s straight forward, but I wanted to connect it to RhinoScript…

thanks,
Tobias

Hi Tobias,

maybe this is useful ?

c.

Hey, I just had a very quick view but it looks promising. Thank you. Good find!

greetins,
Tobias

In case you are processing huge and complex XML, you can try SAX approach. For example, here is one script I’ve did: https://github.com/ll--/Rhino-OSMImport/blob/master/dev/osm_parser.py The handler object there is specific to my project and maybe bit overcomplicated but idea is there.