From: "James Britt (rubydev)" Date: 2001-11-14T10:51:31+09:00 Subject: [ruby-talk:25125] Re: REXML inserting an element Er, can we have both? The "insert where the XPath points" method looks nice. James > > 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 >