Read XML files


#1

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


#2

@tobias,

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

c.


#3

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

thanks,
Tobias


#4

Hi Tobias,

maybe this is useful ?

c.


#5

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

greetins,
Tobias


#6

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.