<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><SPAN class=300411817-28022002>Sorry, i'm explain 
badly.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=300411817-28022002></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=300411817-28022002>All I want is to add 
a Node before another one in some case.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=300411817-28022002></SPAN></FONT><FONT 
face=Arial size=2><SPAN class=300411817-28022002></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=300411817-28022002>Example when I've 
got :</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=300411817-28022002>    
<root></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=300411817-28022002>        <element 
1></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=300411817-28022002>            
<img/></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=300411817-28022002>        </element 
1></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=300411817-28022002>    
</root></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=300411817-28022002></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=300411817-28022002>I would like to have 
:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=300411817-28022002>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=300411817-28022002>    <root></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=300411817-28022002>        <element 
1></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=300411817-28022002>            
<a href='somwhere'>click here</a></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=300411817-28022002>            
<img/></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=300411817-28022002>        </element 
1></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=300411817-28022002>    </root></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=300411817-28022002></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN class=300411817-28022002>Sorry 
again, but it makes 2 years that I don't deal with DOM, and the last 
time it was with Xerces.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=300411817-28022002></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN class=300411817-28022002>To 
finish, if you think I am not in the good place in this list I will go 
away.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=300411817-28022002></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN class=300411817-28022002>Sorry, 
really sorry</SPAN></FONT></DIV></SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Message d'origine-----<BR><B>De :</B> Bart Read 
  [mailto:bart@wdi.co.uk]<BR><B>Envoyé :</B> jeudi 28 février 2002 
  18:04<BR><B>À :</B> Cédric Dumetz; 
  jdom-interest@jdom.org<BR><B>Objet :</B> Re: [jdom-interest] 
  getElementsByTagName + insertBefore<BR><BR></FONT></DIV>
  <DIV>
  <DIV><FONT face=Arial size=2>Right, stop and think about this.  You're 
  not adding <a href="whatever"> before your <img> element because 
  the <a> element will ENCLOSE <img> like so:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2><a href="whatever"><img 
  src="somethingelse"/></a></FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>See?  So <a> becomes the parent of 
  <img> so you need to remove <img> from the list and replace it 
  with <a> and add <img> as a child element of <a>.  
  Seriously, check out the documentation and read Java and XML by Brett 
  McLaughlin and Jason Hunter -- it won't take long and it'll save you a 
  shedload of time in the long run. ;-)</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV></DIV>
  <DIV>=================================<BR>Bart Read<BR>Senior 
  Developer<BR>Abbotsbury Software Ltd<BR>Abbotsbury, DORSET DT3 4JT<BR>Tel: +44 
  (0) 1305 871543<BR>E-mail: <A 
  href="mailto:bart@wdi.co.uk">bart@wdi.co.uk</A><BR>=================================</DIV></BLOCKQUOTE></BODY></HTML>