Xml parser in sketchup
-
In my current project, REXML is used to parse the xml file containing information used by sketchup. However, REXML hurts the performance very much so that i have to consider another xml parse lib.
From http://www.railstips.org/blog/archives/2008/08/11/parsing-xml-with-ruby/ we can see the http://xml4r.github.io/libxml-ruby/ is good choice, but i am not very familiar with this lib, does anyone have experience for this xml parser?
BTW, my xml file is element base in general. -
With gems that contain native code you bring in platform dependency (whereas pure Ruby was platform-independent).
I haven't yet any experiences with libxml, but I built a solution using the browser's DOM parser (was practical since I have a webdialog anyways). Now it's much faster than ReXML, but I met another bottleneck, SketchUp's speed in creating entities.
-
Thanks for your reply.
Unfortunately, i can not use DOM parser to do xml parsing.
[edit]
I have used the libxml and its performance is good enough for me. I setup the old version libxml and copy the ruby files, dll to plugin folder of sketchup, it works for me.
Advertisement