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!

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).
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.

I did have a bit of trouble running the test case in a full test run, but  
it turned out to be because tc_xml_parser was altering the parser  
configuration, causing the nodes returned by reader to differ from the  
expectations. I've fixed and committed that now.

> 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  
;)

In any case, thanks a million - this is very much appreciated.

Cheers,
-- 
Ross Bamford - [EMAIL PROTECTED]
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to