diff --git a/lib/oga/xml/attribute.rb b/lib/oga/xml/attribute.rb index 7ae5222..e35a1d1 100644 --- a/lib/oga/xml/attribute.rb +++ b/lib/oga/xml/attribute.rb @@ -34,10 +34,11 @@ module Oga # @option options [String] :value # @option options [Oga::XML::Element] :element def initialize(options = {}) - @name = options[:name] - @value = options[:value] - @element = options[:element] - + @name = options[:name] + @value = options[:value] + @element = options[:element] + @decoded = false + @namespace = nil @namespace_name = options[:namespace_name] end diff --git a/lib/oga/xml/element.rb b/lib/oga/xml/element.rb index b8fb16a..9f02f81 100644 --- a/lib/oga/xml/element.rb +++ b/lib/oga/xml/element.rb @@ -34,10 +34,11 @@ module Oga def initialize(options = {}) super - @name = options[:name] - @namespace_name = options[:namespace_name] - @attributes = options[:attributes] || [] - @namespaces = options[:namespaces] || {} + @name = options[:name] + @namespace_name = options[:namespace_name] + @attributes = options[:attributes] || [] + @namespaces = options[:namespaces] || {} + @available_namespaces = nil link_attributes register_namespaces_from_attributes