ARTICLE AD BOX
With the following code:
require 'nokogiri' class MyDocument < Nokogiri::XML::SAX::Document def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) a = attrs.map {|e| [e.localname,e.value]}.to_h puts("name=#{name.inspect} #{a.inspect}") end end handler = MyDocument.new parser = Nokogiri::XML::SAX::Parser.new(handler) parser.parse('<root a="attribute & cie"/>')I get:
name="root" {"a"=>"attribute & cie"}& is not unescaped by the parser. Why? It works for < >, but not &
I don't understand
