[this answer cc'd to email] chad fowler <chadfowler / yahoo.com> writes: > Jim, excellent work on this! I've had time to play > around with it briefly and was really impressed. *Blush* Thank you. By the way, version 0.3.0 will be coming out tomorrow morning. It includes a DOCTYPE external id bug fix, improved error messages, the ability to read the XML line number from the SAX parser, and the ability to parse anything that has a "read" method (IO, File, Tempfile, and any new class that you care to throw at it). > A question for both Jim and the community at large. > Would there be value in making the interfaces to NQXML > and the existing expat-based xmlparser compatible? > There has been recent discussion wrt including an XML > parser in ruby proper and some valid concerns were > raised about requiring expat as a standard part of > ruby. That makes sense, I suppose. I have used expat before, in both Java and Perl. I started NQXML by mimicking parts of the SAX implementation. After thinking a bit, I decided that I preferred an approach that was more "purely OO" (whatever that means). You can tell that expat lives in a functional world: its SAX parser uses callbacks and "type, name, data" triplets. I have decided that I don't like it, especially in Ruby where I could easily pass back a real, live object instead of a "type, name, data" trio. I have not played with xmlparser's or expat's DOM interface at all. I *do* plan to create a writer that outputs XML from a Document object. In summation, my feeling is that this is not C, it's Ruby. Let's show off what Ruby can do. > If NQXML and xmlparser implemented the same > interfaces, a developer could easily develop with a > standard xml library (distributed as part of ruby) and > then switch to expat for a speed boost if their > environment allowed it. That is indeed a strong point. I'll think about what it might take to support both the interface I am developing and the expat/xmlparser interface. I'm not keen on it, but will consider the possiblity if enough people feel a burning desire for compatability. I won't guarantee 100% percent compatability, though: I want NQXML to be elegant (for *my* definition of elegant) instead of a clone of expat. Jim -- Jim Menard, jimm / io.com, http://www.io.com/~jimm/ "I know you're not all figments of my imagination, because if you were, you'd all look like beautiful models, and you'd also all be giving me money. That's what *I* would imagine." -- Paul L. Kelly in r.h.o.d