From daed03f7ecb2623d47fe4a2842d0325ac507dd78 Mon Sep 17 00:00:00 2001 From: ser Date: Wed, 7 Apr 2004 14:14:46 +0000 Subject: REXML CHANGES The previous bug fixing the behavior of Element::text= introduced a bug that occurred when calling (el.text = nil) to delete the first text node. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/element.rb | 6 +++--- lib/rexml/rexml.rb | 40 ++++++++++++++++++---------------------- 2 files changed, 21 insertions(+), 25 deletions(-) (limited to 'lib/rexml') diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index d616d0311f..aba57d708c 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -429,7 +429,7 @@ module REXML element = @elements[ path ] rv = element.get_text unless element.nil? else - rv = find { |node| node.kind_of? Text } + rv = @children.find { |node| node.kind_of? Text } end return rv end @@ -457,8 +457,8 @@ module REXML def text=( text ) if text.kind_of? String text = Text.new( text, whitespace(), nil, raw() ) - else - text = Text.new( text.to_s, whitespace(), nil, raw() ) unless text.kind_of? Text + elsif text and !text.kind_of? Text + text = Text.new( text.to_s, whitespace(), nil, raw() ) end old_text = get_text diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb index f14b1902d6..18bdbc337d 100644 --- a/lib/rexml/rexml.rb +++ b/lib/rexml/rexml.rb @@ -1,26 +1,22 @@ -# REXML is an XML parser for Ruby, in Ruby. -# -# URL: http://www.germane-software.com/software/rexml -# Author: Sean Russell -# Version: 3.0.1 -# Date: +2004/093 - - - -# -# Short Description: -# Why did I write REXML? At the time of this writing, there were already -# two XML parsers for Ruby. The first is a Ruby binding to a native XML -# parser. This is a fast parser, using proven technology. However, -# it isn't very portable. The second is a native Ruby implementation, but -# I didn't like its API very much. I wrote REXML for myself, so that I'd -# have an XML parser that had an intuitive API. +# REXML is an XML toolkit for Ruby[http://www.ruby-lang.org], in Ruby. # -# API documentation can be downloaded from the REXML home page, or can -# be accessed online at http://www.germane-software.com/software/rexml_doc -# A tutorial is available in docs/tutorial.html +# REXML is a _pure_ Ruby, XML 1.0 conforming, +# non-validating[http://www.w3.org/TR/2004/REC-xml-20040204/#sec-conformance] +# toolkit with an intuitive API. REXML passes 100% of the non-validating Oasis +# tests[http://www.oasis-open.org/committees/xml-conformance/xml-test-suite.shtml], +# and provides tree, stream, SAX2, pull, and lightweight APIs. REXML also +# includes a full XPath[http://www.w3c.org/tr/xpath] 1.0 implementation. Since +# Ruby 1.8, REXML is included in the standard Ruby distribution. +# +# Main page:: http://www.germane-software.com/software/rexml +# Author:: Sean Russell +# Version:: 3.0.3 +# Date:: +2004/098 +# +# This API documentation can be downloaded from the REXML home page, or can +# be accessed online[http://www.germane-software.com/software/rexml_doc] module REXML Copyright = "Copyright © 2001, 2002, 2003, 2004 Sean Russell " - Date = "+2004/093" - Version = "3.0.1" + Date = "+2004/098" + Version = "3.0.3" end -- cgit v1.2.3