Firstly: REXML Sucks!

good grief: <http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby- talk/161603>

Text.new("&nbsp;",false,nil,false).to_s
=> "&nbsp;"

I've added this currently failing test to server_test.rb:

  def test_entities
    @connection.add(:id => 1, :title_text => "&nbsp;")
    response = @connection.query('nbsp')
    assert_equal 1, response.total_hits
    assert_equal '1', response.hits[0]['id']
  end

This works fine with libxml, but fails with REXML because of REXML's ridiculous escape-everything-not-already-escaped policy. At the moment I'm not sure how to resolve this, and I'm not currently sure how acts_as_solr worked with REXML any differently. Thiago - can you shed any light on that?

My vote is to get rid of REXML support in solr-ruby and either require libxml-ruby to be installed or find some other lighter weight replacement.

Thoughts?

        Erik



On Jun 19, 2007, at 9:55 PM, Thiago Jackiw wrote:

There's something funky with solr-ruby's xml processing when adding
documents, but I don't really know what it is yet. It can't process
html entities at all, not even an html blank space "&nbsp;":

SEVERE: org.xmlpull.v1.XmlPullParserException: could not resolve
entity named 'nbsp' (position: START_TAG seen ... to participate and
contribute to the Open Source Community.&nbsp;... @1:1085)

Please look into it as soon as possible, acts_as_solr is using
solr-ruby as the backend it cannot have a buggy behavior.

Thanks.

--
Thiago Jackiw
acts_as_solr => http://acts-as-solr.railsfreaks.com

Reply via email to