From: Sean Russell Date: 2001-11-14T09:52:19+09:00 Subject: [ruby-talk:25124] RE: REXML inserting an element Ben Schumacher wrote: > Here is are some examples of how to do inserts. .... > These are documented here: > http://www.germane-software.com/~ser/software/rexml/tutorial.html BTW, I've always thought the way REXML does inserts now was rather tedious. Any suggestions on better ways of doing this? How about: c_element = Element.new("c") doc.elements["a/b[position()=1]"].insert_after_me( c_element ) or perhaps ... b_element.next_sibling = c_element I'm partial to the last. Vote now or forever hold your peace. :-) -- --- SER