From: unbewusst.sein@... (=?ISO-8859-1?Q?Une_B=E9vue?=)
Date: 2011-05-31T16:05:29+09:00
Subject: Nokogiri : Modifying Nodes and Attributes
In my test i do have :
Because i know this declaration is false from Lynx saying it is UTF-8, i
want to change the content attribute by :
meta=doc.at_xpath("/html/head/meta")
meta['content']="text/html; charset=UTF-8" if !meta.nil? &&
meta['http-equiv'].downcase=='content-type'
however, printing meta gives always :
that's to say, no change at all.
Is this behaviour implied by the fact the meta tag isn't self closed, ie
not ending by " />" ???
If yes, in that case i could unling all meta tags and create a good one
?
No quicker solution ?
--
� 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)