The one other thing (hopefully this is the last) that I can not figure out how to do is replace a node with another node.

say I have

<foo>
  <bar>
    <baz>
      <woot/>
   </baz>
  </bar>
</foo>

I want to replace baz with <new_data/> so the result would look like this

<foo>
  <bar>
    <new_data/>
  </bar>
</foo>

with rexml, I had a helper method which would do it that consisted of

def replace_element(target_element, replacement_element)
   target_element.replace_with(replacement_element)
end

With rexml, I could also get an elements position relative to it's parent and replace by index.

Any suggestions?  Thanks for helping the noob.

Doug



_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to