summaryrefslogtreecommitdiff
path: root/lib/rexml/parsers/baseparser.rb
diff options
context:
space:
mode:
authorser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-23 15:44:30 +0000
committerser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-23 15:44:30 +0000
commitd15f41b0eb0f284cb15ee814c691e556ae20d8b1 (patch)
treeb2ee8d4e0c6f78c96cfa26c1d2a754e12fc82151 /lib/rexml/parsers/baseparser.rb
parent7792d9026a592ffc9714bec34d9b911b226036e7 (diff)
* Non-String attributes are now converted to Strings; this means code such as
elem.attributes["a"] = 1 will not cause an error when dumping the XML. It also means that: elem.attributes["a"] # => "1", not 1 * Transitive indenting has been cleaned up. * Fixed a potential bug in parsing non-ASCII encoded streams * Fixed a bug where trying to fill in ParseException data was causing an IO error (stream closed) * Changes to Text mean that Element (and Text) can be used outside of a Document context. * In some rare cases, the base parser wasn't reading enough bytes from the stream for the parsing algorithm to work properly. This has been fixed (this was Ruby bug #48426) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/parsers/baseparser.rb')
-rw-r--r--lib/rexml/parsers/baseparser.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb
index 025d43db54..92033a9c2b 100644
--- a/lib/rexml/parsers/baseparser.rb
+++ b/lib/rexml/parsers/baseparser.rb
@@ -166,7 +166,7 @@ module REXML
return [ :end_element, x ]
end
return @stack.shift if @stack.size > 0
- @source.read if @source.buffer.size==0
+ @source.read if @source.buffer.size<2
if @document_status == nil
@source.consume( /^\s*/um )
word = @source.match( /(<[^>]*)>/um )
@@ -199,7 +199,7 @@ module REXML
args = [ :start_doctype, name, pub_sys, long_name, uri ]
if close == ">"
@document_status = :after_doctype
- @source.read if @source.buffer.size==0
+ @source.read if @source.buffer.size<2
md = @source.match(/^\s*/um, true)
@stack << [ :end_doctype ]
else
@@ -208,7 +208,7 @@ module REXML
return args
else
@document_status = :after_doctype
- @source.read if @source.buffer.size==0
+ @source.read if @source.buffer.size<2
md = @source.match(/\s*/um, true)
end
end