[jdom-interest] help XMLOutputter
Lopez, William
william.lopez at eds.com
Fri Oct 26 06:54:05 PDT 2001
The issue I'm having is probably more of a "basic" coding issue than a JDOM
issue but I'll try my luck here first.
I'm attempting to use the XMLOutputter class to create XML files from a JDOM
object that is retrieving Clob files from a database so I can see the test
data. Here's the code for that piece:
inputsource = new InputSource(is);
doc = builder.build(inputsource);
StringBuffer sb = new StringBuffer();
String wholeTime = new
java.sql.Timestamp(System.currentTimeMillis()).toString();
String date = wholeTime.substring(0, 10);
sb.append(date).append("_");
sb.append(wholeTime.substring(11,19));
String newTime = sb.toString();
String file = "c:/Documents and
Settings/xzs3h2/jbproject/DTDMap/acceptance.xml";
OutputStream os = new FileOutputStream(file, true);
XMLOutputter xo = new XMLOutputter(" ", true, "UTF-8");
xo.setTextNormalize(true);
xo.output(doc, os);
This works but I don't want to append [new FileOutputStream(file, true);]
each XML image in the one acceptance.xml file. I was trying to use the
following code to create different file names: String file = "c:/Documents
and Settings/xzs3h2/jbproject/DTDMap/" + newTime + "_acceptance.xml"; but I
was receiving a "bad parameter" error message at: OutputStream os = new
FileOutputStream(file, true);
Sorry for the newbie question but any suggestions would be appreciated.
Thanks,
William Lopez
EDS - Health and Insurance Solution Centre
MS C3-1C-37
5400 Legacy Drive
Plano, TX 75024
* phone: +01-972-604-3372 (834-3372)
* mailto:william.lopez at eds.com
www.eds.com
More information about the jdom-interest
mailing list