[jdom-interest] XML file corrupted by XMLOutputer

Jason Hunter jhunter at collab.net
Thu Mar 22 16:39:43 PST 2001


I would suggest you:

a) Try the same remove operation in a standalone app (outside the
servlet environment) because it's likely something fishy is happening
with your servlet output stream.

b) If the corruption still happens, send in the code that reproduces the
problem (even if it only *sometimes* reproduces the problem).

-jh-

pys at volga.fr wrote:
> 
> Removing child element from an element using removeContent(Element e) and
> then writing back to the xml file sometimes produces garbage at the end of
> the file for example :
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <messages>
> </messages>
> 
> 85019552720">
>                 <date>19/03/2001&amp;nbsp;&amp;nbsp;17:32</date>
>                 <texte>message 6</texte>
>         </message>
> </messages>
> 
> I couldn't figure when exactly this happens. mor often, it happens after the
> third removing. But sometimes it only happens when removing the last
> element, like in this example. (Not the last in the document, but the last
> when all other elements have been removed, in any order.)
> 
> Of course, there is an obvious work arround which consist in making a copy
> of the document without including the removed element, but this is not very
> satisfying.
> 
> Version is Beta 6, used in a servlet, with J2SDK 1.3 and Tomcat 3.1 under
> Win98
> Any idea about what can be going wrong ?
> 
> Pierre-Yves Saumont
> Volga Diffusion
> pys at volga.fr
> 
> PS : I apologize if it happens that this message was send twice, but I had a
> server problem while sending it an as I didn't get a copy back in my
> mailbox, I presume it did not get through the first time.
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list