diff patch

uruz <[email protected]> Tue, 25 May 2004 10:05:01 +0200
Newsgroups gmane.comp.lang.ruby.german
Message-ID <[email protected]>
hi leute
eine blöde frage was mache ich mit einem diff patch wie dem folgenden? 
hab so noch nie gepatcht

Hi,

I think attribute values shuld be unnormalized in stream
parsing. Because text is unnormalized.

P.S.
  Congratulations, SER!!
  Sorry I'm late.

--
kou

------------------------------------------------------------------------

Index: lib/rexml/parsers/sax2parser.rb
===================================================================
RCS file: /src/ruby/lib/rexml/parsers/sax2parser.rb,v
retrieving revision 1.5
diff -u -p -r1.5 sax2parser.rb
--- lib/rexml/parsers/sax2parser.rb	13 Feb 2004 22:40:14 -0000	1.5
+++ lib/rexml/parsers/sax2parser.rb	24 May 2004 15:22:32 -0000
@@ -89,6 +89,7 @@ module REXML
 						if procs or listeners
 							# break out the namespace declarations
 							# The attributes live in event[2]
+							event[2].collect! {|n, v| [n, @parser.normalize(v)]}
 							nsdecl = event[2].find_all { |n, value| n =~ /^xmlns(:|$)/ }
 							nsdecl.collect! { |n, value| [ n[6..-1], value ] }
 							@namespace_stack.push({})
Index: lib/rexml/parsers/streamparser.rb
===================================================================
RCS file: /src/ruby/lib/rexml/parsers/streamparser.rb,v
retrieving revision 1.2
diff -u -p -r1.2 streamparser.rb
--- lib/rexml/parsers/streamparser.rb	16 May 2004 19:18:58 -0000	1.2
+++ lib/rexml/parsers/streamparser.rb	24 May 2004 15:22:32 -0000
@@ -14,7 +14,10 @@ module REXML
 					when :end_document
 						return
 					when :start_element
-						@listener.tag_start( event[1], event[2] )
+						attrs = event[2].collect do |n, v|
+							[n, @parser.unnormalize( v )]
+						end
+						@listener.tag_start( event[1], attrs )
 					when :end_element
 						@listener.tag_end( event[1] )
 	


-- 
thx
martin pfeffer
at
suse 9.0
Apache 2.0
ruby 1.8.0 (2003-08-04) [i686-linux]
http://eurowalker.is.dreaming.org