From: unbewusst.sein@... (=?ISO-8859-1?Q?Une_B=E9vue?=) Date: 2011-05-31T16:30:27+09:00 Subject: Re: Nokogiri : Modifying Nodes and Attributes Une B�vue wrote: > If yes, in that case i could unling all meta tags and create a good one > ? This doesn't work too : metas=doc.xpath("/html/head/meta") metas.each {|x| x.unlink} meta=Nokogiri::XML::Node.new "meta", doc meta['http-equiv']="content-type" meta['content']="text/html; charset=UTF-8" printing head tag gives : ... then, i got back 2 times the meta tag, the older one and the new one - correct... my first Nokogiri line being : doc=Nokogiri::HTML(html) { |config| config.noblanks.noent } the original html starting with : where the meta tag is well balanced by " />" ... -- � Tout le monde savait que c'�tait impossible � faire. Puis un jour quelqu'un est arriv� qui ne le savait pas, et il l'a fait. � (Winston Churchill)