S
SashaNYC
I've looked all over and haven't seemed to find anything relating to my
problem:
Basically, I'm running a J2EE app on tomcat (developing in
websphere/server) and am creating an editor that accesses/updates an
xml file, all using Xerces.
First, I'm importing the xml from the file into a Document object,
delete a node, and print its contents: which all works.
But then, in order to update that file, I do this:
XMLSerializer xmlSer;
OutputFormat out;
out = new OutputFormat(doc);
out.setIndenting(true);
xmlSer = new XMLSerializer(new FileOutputStream(new File(xmlFile)),
out);
xmlSer.serialize(doc);
THIS WORKS--BUT....Only after I log out of the j2ee app and close out
IE6.
I've already tried doing instead so that I know i'm flushing to and
closing the file, but same thing happens. And it happens in both
Tomcat and Websphere Server:
FileOutputStream file = new FileOutputStream(xmlFile);
OutputStreamWriter out = new OutputStreamWriter(file, "UTF-8");
Transformer serializer =
TransformerFactory.newInstance().newTransformer();
serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
// write to file
serializer.transform(new DOMSource(doc.getDocumentElement()), new
StreamResult(file));
file.flush();
file.close();
Any ideas why/how I can fix this?
problem:
Basically, I'm running a J2EE app on tomcat (developing in
websphere/server) and am creating an editor that accesses/updates an
xml file, all using Xerces.
First, I'm importing the xml from the file into a Document object,
delete a node, and print its contents: which all works.
But then, in order to update that file, I do this:
XMLSerializer xmlSer;
OutputFormat out;
out = new OutputFormat(doc);
out.setIndenting(true);
xmlSer = new XMLSerializer(new FileOutputStream(new File(xmlFile)),
out);
xmlSer.serialize(doc);
THIS WORKS--BUT....Only after I log out of the j2ee app and close out
IE6.
I've already tried doing instead so that I know i'm flushing to and
closing the file, but same thing happens. And it happens in both
Tomcat and Websphere Server:
FileOutputStream file = new FileOutputStream(xmlFile);
OutputStreamWriter out = new OutputStreamWriter(file, "UTF-8");
Transformer serializer =
TransformerFactory.newInstance().newTransformer();
serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
// write to file
serializer.transform(new DOMSource(doc.getDocumentElement()), new
StreamResult(file));
file.flush();
file.close();
Any ideas why/how I can fix this?