1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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/trunk@6121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ser 2004-04-07 14:14:46 +00:00
parent df84c64be9
commit 8586deca95
2 changed files with 21 additions and 25 deletions

View file

@ -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

View file

@ -1,26 +1,22 @@
# REXML is an XML parser for Ruby, in Ruby.
#
# URL: http://www.germane-software.com/software/rexml
# Author: Sean Russell <ser@germane-software.com>
# 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 <serATgermaneHYPHENsoftwareDOTcom>
# 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 <ser@germane-software.com>"
Date = "+2004/093"
Version = "3.0.1"
Date = "+2004/098"
Version = "3.0.3"
end