Hi,
I am trying to change the contents of a the HTML tag called "value".
In Nokogiri 1.5.0 the following statement was working just fine:controlXml.elements.at("value").text = "some text"
but after upgrade to Nokogiri 1.5.7 it fails
#!/usr/bin/env rubyrequire "nokogiri"puts Nokogiri::VERSIONdoc = Nokogiri::XML %q{<root><foo></foo></root>}doc.at("foo").text = "bleah"puts doc.to_html
1.6.0.rc1/home/miked/foo.rb:7:in `<main>': undefined method `text=' for #<Nokogiri::XML::Element:0x11c950c name="foo"> (NoMethodError)
1.5.0./foo.rb:5: undefined method `text=' for #<Nokogiri::XML::Element:0x3f854ebdb290 name="foo"> (NoMethodError)
and works only if I make the above statement is replaced as follows:
controlXml.at_css("value").content = "some text"
controlXml.to_htmlThis happens only if I try reassignment of the content because if I try extracting the content using ".text", it works fine. For example the following works:
text = controlXml.elements.at("value").text
puts textCan someone please tell me the reason for this?
I have many places in my code where I reassign the contents using ".text" which is failing. Has something been made obsolete during the upgrade? Is there some way that I can make the ".text" work? Please help.
--Thanks,
Hospira
You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nokogiri-tal...@googlegroups.com.
To post to this group, send email to nokogi...@googlegroups.com.
Visit this group at http://groups.google.com/group/nokogiri-talk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.