[jdom-interest] help XMLOutputter

Wes Rood Wes_Rood at mgic.com
Fri Oct 26 07:49:02 PDT 2001

I think it may have something to do with your file separator slash.

Try either a double backslash in your string - \\ or try explicitly using 
File.separator, that will take the correct file separator for your 

I've also had problems using spaces in filenames occasionally.  This is 
less likely, but if the slash change doesn't work, try renaming your 
subdirectory to one without spaces.


Mark Bennett <mbennett at ideaeng.com>
Sent by: jdom-interest-admin at jdom.org
10/26/2001 09:28 AM
Please respond to mbennett

        To:     "Lopez, William" <william.lopez at eds.com>, jdom-interest at jdom.org
        Subject:        RE: [jdom-interest] help XMLOutputter

Hello William,

No problem on the question; newbies unite!  :)

Where you have:
String file = "c:/Documents and Settings/xzs3h2/jbproject/DTDMap/" + 
+ "_acceptance.xml";

Could you check the value of the file variable after this command?  Either
in your debugger or maybe with:

System.out.println( "file name ='" + file + "'" );

That might be helpful for debugging.


-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]On
Behalf Of Lopez, William
Sent: Friday, October 26, 2001 6:54 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] help XMLOutputter

The issue I'm having is probably more of a "basic" coding issue than a 
issue but I'll try my luck here first.

I'm attempting to use the XMLOutputter class to create XML files from a 
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
      String date = wholeTime.substring(0, 10);
      String newTime = sb.toString();

      String file = "c:/Documents and
      OutputStream os = new FileOutputStream(file, true);
      XMLOutputter xo = new XMLOutputter("   ", true, "UTF-8");
      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 
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.


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

To control your jdom-interest membership:

To control your jdom-interest membership:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20011026/56153c04/attachment.htm

More information about the jdom-interest mailing list