Sha256: dfd4169f31ff5fd70d7764a8a938d6b976e7dea2a3407d48c67687a231c7aeb4

Contents?: true

Size: 797 Bytes

Versions: 21

Compression:

Stored size: 797 Bytes

Contents

require 'xml'

str = <<-STR
  <html>
     <body>
         <div class="textarea" id="t1"
  style="STATIC">werwerwerwerwer                 </div>
         <div class="textarea" id="t2" style="STATIC">
             Quisque et diam dapibus nisi bibendum blandit.
         </div>
         <div class="textarea" id="t3" style="STATIC">
             <p>aaaaaaaaa</p>
         </div>
     </body>
  </html>
STR

XML::Parser.default_keep_blanks = false
xp = XML::Parser.new
xp.string = str
doc = xp.parse

xpath = "//div[@id='t1']"
div1 = doc.find(xpath).to_a[0]
printf "xxx div1: #{div1}\n"

xpath = "//div[@id='t2']"
div2 = doc.find(xpath).to_a[0]
printf "xxx div2: #{div2}\n"


div2.each do |child|
   #c = child.clone
   c = child.copy(false)
   div1.child_add(c)
end

printf "xxx root: #{doc.root}\n"

Version data entries

21 entries across 21 versions & 5 rubygems

Version Path
libxml-jruby-modified-1.0.2-jruby test/ets_copy_bug3.rb
libxml-jruby-modified-1.0.1-jruby test/ets_copy_bug3.rb
libxml-fixed-jruby-1.0.0-jruby test/ets_copy_bug3.rb
libxml-jruby-fixed-1.0.0-jruby test/ets_copy_bug3.rb
libxml-jruby-1.0.0 test/ets_copy_bug3.rb
libxml-ruby-0.8.2 test/ets_copy_bug3.rb
libxml-ruby-0.8.2-x86-mswin32-60 test/ets_copy_bug3.rb
libxml-ruby-0.9.1-x86-mswin32-60 test/ets_copy_bug3.rb
libxml-ruby-0.9.2 test/ets_copy_bug3.rb
libxml-ruby-0.9.2-x86-mswin32-60 test/ets_copy_bug3.rb
libxml-ruby-0.9.1 test/ets_copy_bug3.rb
libxml-ruby-0.9.0-x86-mswin32-60 test/ets_copy_bug3.rb
libxml-ruby-0.9.0 test/ets_copy_bug3.rb
libxml-ruby-0.8.3-x86-mswin32-60 test/ets_copy_bug3.rb
libxml-ruby-0.8.3 test/ets_copy_bug3.rb
libxml-ruby-0.9.3-x86-mswin32-60 test/ets_copy_bug3.rb
libxml-ruby-0.9.3 test/ets_copy_bug3.rb
libxml-ruby-0.9.5-x86-mswin32-60 test/ets_copy_bug3.rb
libxml-ruby-0.9.4 test/ets_copy_bug3.rb
libxml-ruby-0.9.4-x86-mswin32-60 test/ets_copy_bug3.rb