I'm having the same issue. It seems the issue manifest itself when callbacks is set. Below is an example; if I remove DOCTYPE tag, the problem is gone. Any ideas on solutions or workarounds?

class Handler
  include XML::SaxParser::Callbacks
  def on_start_element(element, attributes)
    puts element
  end
end

xp = XML::SaxParser.new
xp.callbacks = Handler.new
xp.string = <<-EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Results SYSTEM "results.dtd">
<Results>
<a>a1</a>
</Results>
  EOS
xp.parse

Works here. See the last test case in tc_sax_parser.rb (from the original bug report).

To be sure, I did this:

  class DocTypeCallback
    include XML::SaxParser::Callbacks
    def on_start_element(element, attributes)
      puts element
    end
  end

  def test_doctype
    @xp.callbacks = DocTypeCallback.new
    @xp.string = <<-EOS
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE Results SYSTEM "results.dtd">
      <Results>
        <a>a1</a>
      </Results>
    EOS
    doc = @xp.parse
    assert_not_nil(doc)
  end


And it works fine. So...let's make sure we are all using the same versions. Libxml_ruby version? libxml version? Operating system? Etc.

Charlie

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to