Shedding more light on the REXML issue, with Ruby 1.8.6 it works!
irb(main):003:0> REXML::Text.new(" ",false,nil,false).to_s
=> " "
irb(main):004:0> REXML::Text.new("&",false,nil,false).to_s
=> "&"
So, do we require a higher version of Ruby (I was using 1.8.4
before)? Or.. ?
Erik
On Jun 24, 2007, at 11:02 AM, Erik Hatcher wrote:
Firstly: REXML Sucks!
good grief: <http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-
talk/161603>
Text.new(" ",false,nil,false).to_s
=> " "
I've added this currently failing test to server_test.rb:
def test_entities
@connection.add(:id => 1, :title_text => " ")
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 " ":
SEVERE: org.xmlpull.v1.XmlPullParserException: could not resolve
entity named 'nbsp' (position: START_TAG seen ... to participate and
contribute to the Open Source Community. ... @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