Results 1 to 3 of 3
  1. #1
    JThangiah is offline Member
    Join Date
    Mar 2008
    Posts
    4
    Rep Power
    0

    Default Writing an XML output

    Hi all,
    I am writing a Java program that needs to output an XML file with the calculated results. Can somebody help me getting started on how I should do it?
    Thanks,
    Jeyanthi

  2. #2
    DonCash's Avatar
    DonCash is offline Moderator
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    240
    Rep Power
    9

    Default

    Hey.

    Well to write to a file you would need to do this:

    Java Code:
    Writer output = null;
    output = new BufferedWriter(new FileWriter("my_document.xml"));
    String newline = System.getProperty("line.separator");
    
    output.write("<tag>calculated results</tag>");
    output.write(newline);
    
    output.close();
    Obviousally you would need to format the output correctly to be a proper xml document.

    Hope that helps you get started!! :)

  3. #3
    JThangiah is offline Member
    Join Date
    Mar 2008
    Posts
    4
    Rep Power
    0

Similar Threads

  1. Output to excel
    By abhiN in forum New To Java
    Replies: 2
    Last Post: 03-07-2008, 02:19 AM
  2. Output problem
    By jvasilj1 in forum New To Java
    Replies: 0
    Last Post: 01-31-2008, 07:39 PM
  3. output
    By Camden in forum New To Java
    Replies: 3
    Last Post: 12-01-2007, 11:34 PM
  4. How to redirect the output
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 10-04-2007, 10:30 PM
  5. No output shown
    By ai_2007 in forum Advanced Java
    Replies: 4
    Last Post: 07-10-2007, 10:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •