On Nov 30, 2006, at 6:46 PM, Ross Bamford wrote: > On Wed, 29 Nov 2006 17:34:53 -0000, Laurent Sansonetti > <[EMAIL PROTECTED]> > wrote: > >> As promised, here is a first patch to bring xmlTextReader to libxml- >> ruby. > > Too cool :) It seems to work great, and I like the API. Thanks so > much for > this!
Excellent, thank you :) > There are just a couple of things I'd propose: maybe we should rename > XML::Reader.walker to XML::Reader.document, and also alias > XML::Reader.new > to XML::Reader.string. IMO it seems more consistent (all constructors > named for the argument they take). Good ideas. Maybe we could perhaps add XML::Document#reader that would do XML::Reader.walker(self). > Also, I think it could be useful to have methods like the following: > > class XML::Reader > class << self > > def read_string(str) > rdr = new(str) > yield rdr while rdr.read == 1 > end > > def read_document(xmldoc) > # ... > end > > def read_file(filename) > # ... > end > > end > end > > These could be done as ruby methods defined in libxml.rb. Mmh, this could be interesting indeed. Something we should think about. >> The patch contains some test cases, but everything is not >> covered (yet). Also, there is no RDoc comments yet, I would like to >> be >> sure that you agree with the API before starting to document it :) > > I wonder, any chance you might join the project, commit this patch, > and > document it in CVS? That way, you'll be able to help maintain the > code too > ;) Sure, I would be honored. My rubyforge username is 'lrz'. > In any case, thanks a million - this is very much appreciated. You're welcome, I'm glad you like it. libxml-ruby is a nice project, it's great to have good libxml2 bindings :) Laurent _______________________________________________ libxml-devel mailing list libxml-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/libxml-devel