RE: [dom4j-user] insert an element

2004-12-09 Thread David Thielen
That did it - thanks -Original Message- From: Maarten Coene [mailto:[EMAIL PROTECTED] Sent: Thursday, December 09, 2004 4:33 AM To: Ben Munat Cc: [EMAIL PROTECTED]; David Thielen Subject: Re: [dom4j-user] insert an element Hi Ben, David, as far as I know this is indeed the only way to

Re: [dom4j-user] insert an element

2004-12-09 Thread Maarten Coene
Hi Ben, David, as far as I know this is indeed the only way to add child Nodes at a given position: int position = [...]; // the position of the new element Element newElement = [...]; // the new element Element parent = [...]; List children = parent.elements(); children.add(position, newEleme

Re: [dom4j-user] insert an element

2004-12-08 Thread Ben Munat
I ran into that at one point... looked and looked but never found anything in the API like a "insertBefore" or "insertAfter"... I think that would be a nice addition, I mean even the w3c DOM has that. On the other hand there's always the good ol' fashioned way: iterating through the children un