negativecode / vines

An XMPP chat server for Ruby.
http://www.getvines.org/
MIT License
470 stars 75 forks source link

Allow vines to work with nokogiri > 1.5.5 #24

Closed elijh closed 11 years ago

elijh commented 11 years ago

Since nokogiri v1.5.6, Nokogiri::XML::Document::create_element has this code:

if ns = elm.namespace_definitions.find { |n| n.prefix.nil? or n.prefix == '' }
  elm.namespace = ns
end

This new nokogiri behavior has the unfortunate consequence of overwriting the namespace set by vines for new nodes in parser.rb.

This pull request changes where the namespace is set by vines so that it does not get overwritten.

Without this change, vines does not work at all with nokogiri > 1.5.5, which is not so good since the current Gemfile will install 1.5.9 by default.

dgraham commented 11 years ago

Thanks!