lib/niceogiri/xml/node.rb in niceogiri-0.1.0 vs lib/niceogiri/xml/node.rb in niceogiri-0.1.1

- old
+ new

@@ -145,10 +145,13 @@ # Inherit a set of attributes # # @param [Hash] attrs a hash of attributes to set on the node # @return [self] def inherit_attrs(attrs) - attrs.each { |name, value| self[name] = value } + attrs.each do |name, value| + attr_name = value.namespace ? [value.namespace.prefix, name].join(':') : name + self.write_attr attr_name, value + end self end # The node as XML #