<!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>If I want to read a fiile in, do something and put
it out in the same file,</FONT></DIV>
<DIV><FONT face=Arial size=2>I try this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> try{<BR> Document doc
= builder.build(fn);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> // to something that
changes the doc</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> File outf = new
File(outfile);<BR> PrintWriter out = new PrintWriter(new
FileWriter(outf));<BR> XMLOutputter outputter = new
XMLOutputter();<BR> outputter.setEncoding("ISO-8859-1"
);<BR> outputter.output(doc, out);</FONT></DIV>
<DIV><FONT face=Arial size=2> }</FONT></DIV>
<DIV><FONT face=Arial size=2> catch (Exception ex)
{<BR>
System.out.println(ex.getMessage());}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>it won't allow access to the file to write out
the changed version.</FONT></DIV>
<DIV><FONT face=Arial size=2>Not sure I understand why because I thought builder
dissociates from</FONT></DIV>
<DIV><FONT face=Arial size=2>the file after its parsed intoa jdom? Whats the
right approach here?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2>Brian</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>