Dom , where goes this file created??

class NewClass1
public static void main(String[] args)
try{
//Create instance of DocumentBuilderFactory
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
//Get the DocumentBuilder
DocumentBuilder docBuilder = factory.newDocumentBuilder();
//Create blank DOM Document
//where this documents goes ??? can't find it
Document doc = docBuilder.newDocument();
//create the root element
Element root = doc.createElement("root");
//all it to the xml tree
doc.appendChild(root);
//create a comment
Comment comment = doc.createComment("This is comment");
//add in the root element
root.appendChild(comment);

I forgot....
If you want to write the document to file explicitly do it - for example:
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class WriteXMLFile
     public static void main(String args []){
          try{
               //Create instance of DocumentBuilderFactory
               DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
               //Get the DocumentBuilder
               DocumentBuilder docBuilder = factory.newDocumentBuilder();
               //Create blank DOM Document
               //where this documents goes ??? can't find it
               Document doc = docBuilder.newDocument();
               //create the root element
               Element root = doc.createElement("root");
               //all it to the xml tree
               doc.appendChild(root);
               //create a comment
               Comment comment = doc.createComment("This is comment");
               //add in the root element
               root.appendChild(comment);
              try {
                 // Prepare the DOM document for writing
                 Source src = new DOMSource(doc);
                 // Prepare the output file
                 File file = new File("myDocument.xml");
                 Result result = new StreamResult(file);
                 // Write the DOM document to the file
                 Transformer xformer = TransformerFactory.newInstance().newTransformer();
                 xformer.transform(src, result);
             } catch (TransformerConfigurationException e) {
             } catch (TransformerException e) {
          catch (Exception e) {
               // TODO: handle exception
}     

Similar Messages

  • I downloaded a word file from an inbox mail (the mail app) onto my iPad2, where is this file stored? How can I delete it if it takes up space in my iPad? Any ideas??

    I downloaded a word file from an inbox mail (the mail app) onto my iPad, where is this file stored? How can I delete it if it takes up space in my iPad? Any ideas??

    Did you ever figure out what happened?
    I had the same experience as you did, but in my case it was a big fat pdf that Mail insisted I had to download before I could view it. As happened with you, I saw the file actually downloading, and after a time I was able to view the pdf. It's been my assumption that the pdf is still somewhere on my iPad, but I have no idea where, nor how to delete it if it is still there.
    Thanks.

  • I uninstalled Norton AntiVirus.  A request to renew keeps popping up everytime I start the computer.  Where is this file hidden?

    I uninstalled Norton AntiVirus.  A request to renew keeps popping up everytime I start the computer.  Where is this file hidden?

    Not needed from the App Store. Go straight to the developer.
    http://www.devontechnologies.com/products/freeware.html
    Also FindAnyFile, which if you Option click Find will search as root.
    http://apps.tempel.org/FindAnyFile/index.php
    For EasyFind, enter the name of the developer or anything else associated with it.

  • Where does Log files created for Timesten?

    Hi!
    my question id that where does log file are created ...my timetsen is installed on linux having locations:
    Installation Directories
    Times Ten Registry     /etc/TimesTen
    Default Installation Directory     /d01/app/oracle/tt70/TimesTen/tt70
    Default temporary directory     /tmp
    Instance name     tt70
    Instance Home Directory     /d01/app/oracle/tt70
    Daemon Home Directory     /d01/app/oracle/tt70/TimesTen/tt70/info
    DemoDataStore Directory     /d01/app/oracle/tt70/TimesTen/tt70/info
    Documentation Directory     /d01/app/oracle/tt70/TimesTen/tt70/doc
    LD_LIBRARY_PATH     /d01/app/oracle/tt70/TimesTen/tt70/lib
    Startup Script     /d01/app/oracle/tt70/TimesTen/tt70/startup/tt_tt70
    regards
    Muh.Usman

    The TimesTen daemon message logs are located in the daemon home directory which by default is <tt_install_dir>/info but can be changed to another location at install time.
    A datastore's transaction log files are located by default in the same diredctory as the checkpoint files (specified by the DSN attribute Datastore) but can be placed eslewhere using the DSN attribute LogDir.
    Again, this is all covered in the documentation. With all due respect, this forum is not intended to be a substitute for reading the comprehensive and well written documentation.
    Chris

  • TS3968 Where is this file?

    I've looked everywhere or this file and I am having trouble locating it... Can someone please tell me where to look?

    The path seems to have changed:
    ftp://ftp.ni.com/support/labwindows/cvi/Run-Time%20Engines/7.0/win32/

  • TS1192 Where is this file - com.apple.iApps.plist?

    It is not in the Preferences folder of my Home folder. I was trying to import my iPhoto photos to Picasa and it suggested I delete this file, because I have a contaminated albumdate.xml file. I am running Lion and iPhoto '11.

    Terence,
    Some additional information -
    1. I'm using iPhoto Library Manager which may explain why the .plist file is missing.
    2. iPhoto has no apparent trouble displaying the files I'm trying to import to Picasa.
    3. Here are the two sequential messages I receive from Picasa:
    Any suggestions?

  • Where does this file go??

    import java.net.URL;
    import java.net.MalformedURLException;
    import java.io.InputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.FileNotFoundException;
    public class Test{
           public static void main(String[] param){
                  if(param.length!=4)
                  System.out.println("please provide 4 attributes: protocol, host, port, and file");
                  try{URL resource = new URL(param[0], param[1], Integer.parseInt(param[2]), param[3]);
                  InputStream openResource = resource.openStream();
                  //StringBuffer sb = new StringBuffer(param[3]);
                  //sb.deleteCharAt(0);
                  //String fileName = sb.toString();
                  //System.out.println(fileName);
                  FileOutputStream toFile = new FileOutputStream(param[3]);
                  for(int i = openResource.read(); i!=-1; i = openResource.read())
                  toFile.write(i);
                  catch(IOException ioe){System.out.println("an ioe occurs");}
                  System.out.println("file downloaded");
    }java Test http www.xxx.com 80 /file.bla
    when I tried the program, it shows me the file is successfully downloaded, but I cant see the file, afterwards I realise the '/' character is not allowed in the Windows Xp.
    but why doesn't the program throw an IO exception? if so, the file must exist in some way, do you know where??
    thanks

    Or better yet, create a File object with the String argument and use that File to open the stream with. Then print File.getAbsolutePath() to determine where it was written.

  • Where are temporary files created for "image capture"?

    Hi all
    I have been using image capture with no problem whatsoever, until recently. I was scanning a big file and while it was saving it or something I closed the lid of the computer and interrupted the scan. Now the scanner can do a preview but is no longer able to "scan" the file that i see perfectly through preview. I think that the problem is that there is a corrupt temporary file somewhere that needs to be manually deleted. If you know where such files are stored or if you have a better idea, please let me know.

    You may be on to the correct solution. I've seen this problem with a big printing job that a user had to cancel and then had to "go in" and delete the print job before they could print again. On the Mac, there is something called CUPS (something Unix Printing System) and it has a role in printing and I believe faxing. It "might" play a role in scanning through Image Capture but I'm not sure. Anyway give it a look and see if there is an incomplete scan job in there that you can delete.
    Note: this looks like a website URL but it leads to CUPS on your Mac.
    http://127.0.0.1:631/jobs/
    This may not be applicable to scanners but it's worth a look.
    Regards,
    Steve M.

  • Where was this file made in OSX Lion?

    Hello all,
    I started a project in FCP and Photoshop almost a year ago that I've just revisited. I can't for the life of me remember if I exported the files from FCP or Photoshop and I want to keep things the same as when I started. How can I find out the info about what application made the files I exported when I began? Thanks so much!

    Some, but not all, applications will tag the files they create with a "metadata attribute" that shows the creator of the file. This is different from the old 4-character "creator code" which is now obsolete. I don't know whether FCP or recent versions of Photoshop add this attribute, but it's worth a look. There may be 3rd-party utilities that can show this tag , but you can also do it with Terminal, as follows:
    Open Terminal (in the Utilities folder), and copy-paste the following line into the Terminal window, followed by typing a single <space>. Do not type <return> yet:
    mdls -name kMDItemCreator
    Next, navigate with Finder to the file of interest, and drag its icon into the Terminal window. Then click inside the Terminal window and type <return>.
    By example, I have a jpg file on a USB flash drive, that is set to open with Preview and carries a Preview icon. Get Info does not show the file's creator. But in Terminal, I get this:
    $ mdls -name kMDItemCreator /Volumes/USB1/IMG_0231.jpg
    kMDItemCreator = "Adobe Photoshop Elements 3.0 Macintosh"
    As mentioned, though, not all applications will add this tag.

  • Where is this file since I don't have it jre1.5.0_02-iftw.msi

    HI for whatever reason and I ha ve no idea what happened but all I know is java doesn't work now. I cna't uninstall from the add/remove programs and aI can't reinstall without that file pretty nice huh I thought so. No one online has that file that I can find and I have no idea where it is and yes I searched on my machine and wow no luck yay. I even searched your site and read countless pages of information. I have learned that each exe comes with it's own msi but then why is it asking for the msi? All of this happened after an update oh yay gotta love those updates.

    Look at
    http://java.sun.com/j2se/1.4.2/docs/guide/deployment/#extracting

  • Where is this file getting generated

    DATA :    w_csv(200) TYPE c. "CSV output file.
      m_check_selscr_fnms c3 o.
      OPEN DATASET w_srvr_nm_o_c3 FOR OUTPUT IN TEXT MODE.
      IF sy-subrc NE 0.
        MESSAGE e001 WITH 'File open error for output' w_srvr_nm_o_c3.
      ENDIF.
      WRITE: / c_output_file, 20 w_srvr_nm_o_c3.
    Thanks in advance
    BWer

    do you have idea about FILE Transaction,
    See the  FILE_GET_NAME Function module and probably they might be using this FM.
    Goto FILE Transaction and look at Logical Path ,Physical path.
    Reward Points if it is helpful
    Thanks
    Seshu

  • PersistanseInfo.sol - how to not have the system create this file ?

    Dear Forum,
    I'M using Captivate 4, under XP and IE8. I noticied that when I run my project, a file (persistanse.info) is created under C:\Documents and Settings\myprofile\Application Data\Macromedia\Flash Player\#SharedObjects\DB3G2542\localhost\myproject\persistanseinfo.sol.
    This file contains navigation history in my project. All the running options in the TOC are disabled.
    ^
    My company uses Roaming profiles, and because of the path length of the file, I have an error (file name or path too long) everytime I logoff.
    Is there a way to not have this file created ?

    If you hold down the option key when starting iTunes, it will allow you to select a library or create a new one.
    You can create a new one, and then add all of your iTunes music back in by simply dragging the old iTunes music file onto iTunes.
    There are more detailed instructions at http://support.apple.com/kb/HT1451#
    It will show you how to re-build your iTunes database file.

  • Where is backup file located

    error message when syncing to my computer:
    Itunes could not backup the ipod because the backup was corupt or not compatable with the ipod.
    delete the backup file for this ipod, then try again.
    Where is this file?
    This started after updating itunes and to os5.

    iTunes places the backup files in the following places:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    Windows Vista and Windows 7: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    Note: If you do not see the AppData or Application Data folders, you may need to show hidden files (Windows XP, Windows Vista, Windows 7), or iTunes may not be installed in the default location. Show hidden files and then search the hard drive for the Backup directory.
    However, you can also delete it by going to iTunes>Preferences>Devices and delete the backup from there.

  • How to view the File created against the Transport Request in ASCII format

    Hi all,
    We have a requirement where in the file created against the Transport reauest and its content should be viewed in ASCII format.
    Experts do you have answer for this.
    Is thers any method to work out.
    Thanks in advance.
    Every usefull answers will be awarded points.*********

    Hi Anji Reddy,
    Thanks for your reply.
    Let me clear my querry.
    when we create a program in se38 and save it in a zxxxx package then it will create a transport request. The Content of TR i mean is not the Program name or the object list in the TR. The content i mean here is the abap code written in the program. which will be stored as a file in the server. when we open this file it will give the SAP format. Which i want to view in ASCII format.

  • Execute listcube in background - where is the file stored on app server

    Hi,
    I want to execute listcube in background.
    to execute in background, the only output option available is Store in file (appl server).
    My question is where is this file stored.
    there is no information in the job log nor is there any spool.
    Also, can I determine myself where is this output file written.

    I have a couple of questions that could lead to an answer to your question...
    Does your BW environment have one or more application servers, in addition to the Database Central Instance (DBCI)? If so, do you use logon groups for SAP Logon so that the logon loads are balanced?
    I'm asking these questions because if you have a multiple application server environment and logon balancing, you may not be logging onto the same server every time that you're executing LISTCUBE and it will save to the directory path of the server you're logged onto.

Maybe you are looking for

  • Mac shuts down without reason - mid use

    I have had my G4 coming up for 4 years. I have noticed in past week that it shuts down - (showing 'power save' on screen) mid use. Is this possibly the internal battery needing replacement - or does it sound like some other problem? (It does not happ

  • Problem in invoice correction (ZRK) with deleted territories.

    Dear Gurus, When invoice correction is created for invoices with deleted territories the correction(ZRK) should go to the new territory but it doesn't happen in the following case.Some time ago we were closing territories by changing account group fr

  • Box inside Main window issue in Scripts

    I have issue in placing a box inside the main window. I would like to display text with a box frame at end of the line items. I tried creating seperate FOOTER window in the Last page, but it dint work as expected, since if the line items ended in the

  • Nokia 5310 (10.10) with 8GB microSDHC crashes when...

    Hi. I'm using a 8GB SanDisk microSDHC card with my Nokia 5310 (newest firmware). Transferring files with Windows Explorer is no problem; when using the Ovi Player the phone frequently crashes after a while, mostly when there is more than 4 GB of data

  • Master Detail Wizard: Cannot Redirect Detail Form to Detail Form 2

    Dear all, I created a Master Detail Report Forms using wizard where Master Report has a link to its Detail1 form, which has a link to its Detail2. However, the page redirection didn't work from Detail1 to Detail2 whereas Master to Detail1 worked. I c