From: Kevin Smith Date: 2001-02-27T01:26:22+09:00 Subject: [ruby-talk:11597] Re: A design/implementation question Dave Thomas wrote: >To do that with the current scheme would require that every client >have the Ruby xmlparser module installed, which in turn requires Jim >Clark's expat library. This seems onerous! > >So, I initially started hacking together yet another flat file >representation of the data. I'd ship it with ri, and when you type >'ruby install.rb', the installer would read it and generate the >marshaled classes. Then that little alarm bell started ringing that >said "there has to be a better way". Unfortunately, the battery ran >down before it got around to telling me what that better way is. How complex is your XML? As I mentioned, I was able to write a very simple, focused XML parser in C++ in a couple hours. To use the class, you would create your own subclass. You would call: Parse(inputstream) Each time a tag was encountered in the stream, a virtual method named tag was called, passing the string containing "<...>". For all non-tag info, a virtual method named output was called with an arbitrary chunk of text. I also had beginComment and endComment calls, that allowed you to know when commented text was being passed to output. Would something like that allow you retain your XML? Kevin