You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xml_string='<root><foo>&</foo><bar><</bar><baz>></baz><bat>"</bat></root>'d=Document.new(xml_string,{raw: ['foo','baz']})d.to_s# => "<root><foo>&</foo><bar><</bar><baz>></baz><bat>"</bat></root>"root=d.root# => <root> ... </>foo,bar,baz,bat= *d.root# Each is an Element object:[foo,bar,baz,bat].map{|e| e.class}.uniq# => [REXML::Element]# Each element is marked as raw/not-raw as appropriate:[foo,bar,baz,bat].map{|e| e.raw}# => [true, false, true, false]# The first child of each is a Text object:[foo,bar,baz,bat].map{|e| e.first.class}.uniq# => [REXML::Text]# Each text is marked as raw/not-raw as appropriate:[foo,bar,baz,bat].map{|e| e.first.raw}# => [true, true, true, true]
Is this correct? I expected that last result to be [true, false, true, false].
The text was updated successfully, but these errors were encountered:
Running ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [i386-mingw32]
Is this correct? I expected that last result to be [true, false, true, false].
The text was updated successfully, but these errors were encountered: