From: daz Date: 2005-11-01T19:17:08+09:00 Subject: Re: bug in REXML escape codes Phlip wrote: > Rubies: > > REXML can't escape & properly: > > require 'test/unit' > require 'rexml/document' > include REXML > > class RexmlIssue < Test::Unit::TestCase > def test_transmitHTMLescapes() > doc = Document.new('') > zone = XPath.first(doc, '/zone') > zone.text = '< > >' > File.open('sample.xml', 'w') {|fh| doc.write(fh) } > sample = File.read('sample.xml') > assert_equal '< > &gt;', sample > end > end > > When I feed REXML > in clear text, it does not expand that into > &gt;. > > So when we read zone.text back, we get '< > >', not '< > >' again. > > I have a patch in my code - I just call a generic escapeHTML() before > stuffing the node's text. But naturally a real fix would be welcome. > This is so like a thread from 11 days ago: http://qurl.net/mz (quod vide) daz