Document write to file

I've parsed an xml file into a Document object, manipulated various nodes, and now i would like to re-write it to a new file. How would I go about doing so? My question is not so much regarding the I/O, but how can the Document object be sent to the output stream?
thanks

It depends what package are you using, with JDOM:
FileOutputStream xml_fos = new FileOutputStream(outputFile);     
XMLOutputter outputter = new XMLOutputter(" ", true);
outputter.output(doc, xml_fos);
xml_fos.flush();
xml_fos.close();
doc is the Document
Regards,
Susana

Similar Messages

  • Where is the document.write calling file?

    I an new on the job and still finding my way around the
    files.
    I need to edit an html file. I find the file, (or, what I
    think is the file) but it is a document.write calling another page.
    I can't find the actual page of code to edit. It is a simple page
    of links and text, but how do I find it? I have the IP address, but
    I see it anywhere and I have a drive mapped. Any suggestions?
    Thanks,
    Patty

    It should be in the Javascript Toolkit Guide which can be found in your Adobe install folder:
    ..Adobe\Adobe Utilities\ExtendScript Toolkit 2\SDK\
    good luck.

  • Why does Firefox 7 freeze when I paste a filename when printing to a file using Microsoft XPS Document Writer?

    This is more of a bug, and it doesn't seem to happen all the time.
    I like printing web pages to Microsoft XPS Document Writer (.xps) format. FF7 seems to freeze often when I paste a filename (usually from copying something, like the title, from the web page itself) after trying to print to a file using Microsoft XPS Document Writer. I think it may be that I wind up copying some special formatting (or maybe a line break) and that causes FF to freeze (I then have to force-close it using Task Manager). Just a bug that I hope the developers will note and fix.
    Another question, not quite related to the above, but is there a way to save an html web page to save only the text stuff? When I save to Text File in Firefox, I usually wind up with all the html crap in it too, when I just wanted the text content portion. TIA.

    Can you undo the system restore?
    Note that using System Restore can cause your Firefox installation to get corrupted because not all files are restored (only files in a white-list), so be cautious with using System Restore.
    *You may lose data in the Firefox profile folder like .js and .ini files pr profiles.ini can be affected.
    *You may need to (re)install software that was affected.
    In case you need to reinstall Firefox then you need to delete the Firefox program folder before reinstalling to make sure that all files get replaced.
    A possible cause is security software (firewall,anti-virus) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls

  • FireFox 3.6.13 Locks up Microsoft XPS Document Writer, PDF995 (created Acrobat pdf file output) stops printing mid document, and Internet Explorer works fine

    Microsoft XPS Document Writer locks up and PDF995.com (creates acrabat pdf file) stops printing after the second page from this site http://super.nova.org/DPR/CinematicApproach/. This was a Windows 7, 64 bit machine that had the issue. Microsoft Internet explorer works fine and printed the document with Internet Explorer.
    The machine that displayed FireFox printing issues was a up to date Win 7, 64 bit, Quad Core, 8 Gig Ram. Don't really have a question just reporting a FireFox Bug.

    Hi,
    do you have a solution for the problem? We have actually a similar problem with locked IE8 when using a zoom factor > 100% (it's a customer WD4A).
    Regards,
    Steffen Brauner
    Edited by: Steffen Brauner on Jul 7, 2011 6:54 AM
    I found the notes 1534606+1534610 that solved my prob.
    Edited by: Steffen Brauner on Jul 7, 2011 6:55 AM

  • There was an error opening this document. This file cannot be found

    An automation script on one of our QA environments kept tripping on the error: "There was an error opening this document. This file cannot be found".  The same script ran fine against our Production servers (hint, which were "whitelisted").
    It took a little time to resolve/trace what was happening (but with the aid of ProcessMonitor and tracing all "pdf"-related file activity...)
    The problem lies squarely between McAfee (75%), Adobe (20%) and Microsoft (5%):
    NORMAL WORKFLOW.  IE (Internet Explorer) when popping a PDF document, has to (1) write the document to the IE cache, then (2) launching and "handing off" the document reference to the Adobe viewer (which might then be able to open the document, et al) -- assuming largely a "synchronous" workflow.
    BUT "WAIT", HOLD THE HORSES -- McAfee takes ownership and decides infact "wait for us" (during the workflow), it wants to first perform a virus scan on the document (ahead of writing the document to cache) involving potentially large latency (delay) before making the document available to the system. However, instead of "fessing up"-that their scan may be taking too long, McAfee appears to have taken their work "off-line" in violation of the sychronous interface above. I'm guessing the developers at McAfee might have been trying to hide any extra processing overhead being incurred by assuming they could somehow convert this to an "asychronous" event.  (This may also have more reach than just PDF's.)
    Unfortunately, the browser's "PDF OPEN"-dialog box pops allowing Adobe to launch-and-open the "as-yet-not-virus-scanned-and-thus-not-yet-cached"-document. Thus clicking the OPEN-button will cause the related "...FILE NOT FOUND"-error to be seen (because the file is still in McAfee "limbo").
    Note: If you close the ADOBE reader (but don't yet close the popup-OPEN-dialog) you can click OPEN a second time and it will probably now open the document - which McAfee finally finished scanning!
    You can observe all these interactions with ProcessMonitor, and use the monitored file states to adjust the timings of events to reproduce both the failure and non-failure scenarios.
    - Best Regards, Ziggy
    ps. My assessed distribution of "ownership" of the problem is because ALL these parties should be aggressively resolving this for the customer-base!

    What, exactly, were you trying to do when you got it, and how?

  • Read PDF Formatted Spool and write PDF File to Application Server

    Hi Experts,
    After ECC 6.0, HR-W2 and W2C Form Spools are getting generated in PDF format.
    We have a requirement wherein we want to read the PDF Spool Programatically and write the PDF file to Application server (Using OPEN DATASET and CLOSE DATASET)
    PARAMETERS : p_spono LIKE tsp01-rqident.
    DATA: pdf_data type FPCONTENT.
    types: lt_pdf_table(1000) type x.
    data:  l_pdf_data type standard table of lt_pdf_table,
           l_pdf_line type lt_pdf_table,
           l_offset type i,
           l_len type i,
           p_file(100) VALUE '\sapout\DVH\pdf2.pdf'.
    *Read the spool content
    CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'
        EXPORTING
             i_spoolid = p_spono
             i_partnum = '1'
        IMPORTING
               e_pdf = pdf_data
    *         e_pdf_file = file
        EXCEPTIONS
             ads_error = 1
             usage_error = 2
             system_error = 3
             internal_error = 4
        OTHERS = 5.
    * Modify the spool  contents to prepare internal table
      l_len = xstrlen( pdf_data ).
      while l_len >= 1000.
        l_pdf_line = pdf_data+l_offset(1000).
        append l_pdf_line to l_pdf_data.
        add 1000 to l_offset.
        subtract 1000 from l_len.
      endwhile.
      if l_len > 0.
        l_pdf_line = pdf_data+l_offset(l_len).
        append l_pdf_line to l_pdf_data.
      endif.
    * GUI DOWNLOAD Works Fine
    * Now pdf contents is ready , lets store in local PC
    *CALL FUNCTION 'GUI_DOWNLOAD'
    *  EXPORTING
    *   filename                        = 'C:\Documents and Settings\Desktop\shital.pdf'
    *   filetype                        = 'BIN'
    *  TABLES
    *    data_tab                        = l_pdf_data.
    OPEN DATASET p_file FOR OUTPUT IN BINARY MODE.
    IF sy-subrc <> 0.
      MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
              ' Error opening file:'(Z03) p_file.
    ENDIF.
    LOOP AT l_pdf_data INTO l_pdf_line.
      TRANSFER l_pdf_line TO p_file.
    ENDLOOP.
    CLOSE DATASET p_file.
    IF sy-subrc <> 0.
      MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
              ' Error closing file:'(Z04) p_file.
    ENDIF.
    Currently as you can see I have commented out GUI_DOWNLOAD Function Module, But it works perfect when I try to Download file to Local Desktop.
    But when I try to pass the same Contents to Application server file and then try to open it by downloading file then it opens BLANK pdf file.
    As per requirements I should be able to write the file correctly on Application server and If I dowload it from there it should open PDF file correctly.
    Let me know if you require further details about the issue.
    Regards
    Shital
    Edited by: shital phadake on Apr 8, 2009 9:39 PM

    Thanks Selçuk for your reply and taking time for understanding the Issue,
    I went thru Functionality of the program you suggested but dont think it matches my requirement.
    Regards
    Shital

  • How can I set Firefox to print to PDF, the only otions I have are (1) My Canon printer, (2) Fax or (3) Microsoft XPS document writer. There is no option for PDF

    A couple of weeks ago, from the file menu, in my print options was to print a web page to PDF, that facility is no longer there. does anyone know how can I set Firefox to print to PDF.
    The only options I have are (1) My Canon printer, (2) Fax or (3) Microsoft XPS document writer. There is no option for PDF

    Firefox generally displays the printers in Windows' Printers folder (Start orb > Devices and Printers). If it is missing one of the printers listed there, could you indicate which one it is, for example, Adobe Distiller, PrimoPDF, CutePDF Writer, etc.?
    If you previously had an add-on which added print-to-PDF functionality just to Firefox, perhaps it got disabled. You could check here:
    orange Firefox button ''or'' classic Tools menu > Add-ons > Extensions
    Also, are you really running Firefox 8.0.1? That version from last November is no longer secure and has been superseded by Firefox 11. If you browse the web widely, you should update for your security.

  • File Open Issues - document library pdf file to open in new browser window

    Hi
    I have a requirement to open the document library containing pdf file to open in new browser window. So far I have tried following steps but could not get it to work.
    1. Changing Document library advance setting to open the document in browser (have tried others as well).
    2. SharePoint web application setting changed as Permissive instead of Strict. Here the pdf file opens in browser but redirect from document library instead of new window(Also tried adding Target=”_blank” and no change).
    3. Executed the powershell script to adding MIME type to see if it works but no change.
    $webApp = Get-SPWebApplication http://SharePointSite
    If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains "application/pdf")
    Write-Host -ForegroundColor White "Adding PDF MIME Type..."
    $webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")
    $webApp.Update()
    Write-Host -ForegroundColor White "Added and saved."
    Else
    Write-Host -ForegroundColor White "PDF MIME type is already added."
    4. Open the Doc library and modified ALLItems.aspx to add Target= “_blank”
    5. I have already tried solutions suggested in the link:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/9db08c4a-b53c-419a-84f8-001c194d1311/how-to-open-sharepoint-document-library-pdf-file-in-new-window?forum=sharepointadminlegacy
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/530e2ea1-d77d-491c-935f-04f536e439a5/open-a-pdf-document-to-a-new-browser-in-the-document-library-web-part?forum=sharepointadminlegacy
    http://mindsharpblogs.com/todd/archive/2005/08/16/654.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/7b6091df-4657-4799-ba02-259ebd7e4b7c/pdf-doesnt-open-in-document-library?forum=sharepointadminlegacy
    Appreciate if there are any working solution from any of you. Many Thanks

    I found a solution which works only in the development. No idea when I compared, Browser MIME type is enabled, STRICT browser type is configured for web application. on the document library advance setting, default to open in new browser. Both configurations
    are identical but I am able to open pdf file in new window in my developing using jquery script
    http://blog.ithinksharepoint.com/2011/02/21/open-pdf-files-from-a-document-library-in-a-new-window/ but the same does not work on production server :(
    Any help experts?
    Thanks

  • Problem using PrintStream to write to file.

    I am trying to write some String data to a file.
    I have replaced System.out with a PrintStream of my own.
    When I open the file with notepad,
    there are little squared at the end of each line with text written.
    I'm guessing they have something to do with
    the default character encoding on a PrintStream Object.
    I am aware that
    "All characters printed by a PrintStream are converted into bytes using the platform's default character encoding".
    as I am aware of the "java.nio.charset.Charset "
    class. I have tryed specifying UTF-8 and US-ASII
    encoding when instantiating a PrintStream Object.
    What can I do to prevent the square being written, and just using default new lines
    there, no matter how the file is viewed?
    (my OS is Windows XP service pack 2)
    ?

    Yes, I have. And yes, one would expect.
    However, it isn't.
    This is just personal code. I am doing the following:
    import java.io.File;
    import org.w3c.dom.*;
    import javax.xml.parsers.*;
    import java.io.*;
    public class DomParsing {
    public static void main (String [] args)
    try
    DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = builderFactory.newDocumentBuilder();
    File file = new File("cd-catalog.xml");
    Node child = null;
    Document document = builder.parse(file);
    Node element = (Node)document.getDocumentElement();
    FileOutputStream fileStream = new FileOutputStream("SCREEN_OUTPUT.txt");
    PrintStream logger = new PrintStream(fileStream,false);
    System.setOut(logger);
    iterate(element);
    logger.close();
    fileStream.close();
    catch (Exception e)
    {e.printStackTrace();}
    //needs closer examination.
    public static void iterate(Node element)
    while(element instanceof Node)
    peekNode(element);
    peekAttributes(element);
    Node [] children = getChildren(element);
    if(children instanceof Node[])
    //Node child = ;
    iterate(children[0]);}
    element = getSibling(element);
    //Suspect may be either of those two instructions.
    if(element instanceof Node)
    //iterate(element);
    continue;
    private static Node [] getChildren(Node element)
    Node [] children = null;
    if(element.hasChildNodes())
    NodeList nodes= element.getChildNodes();
    children = new Node [nodes.getLength()];
    for(int i=0;i<nodes.getLength();i++)
    children[i] = nodes.item(i);
    return children;}
    private static Node getSibling(Node element)
    Node sibling = element.getNextSibling();
    return sibling;}
    private static void peekNode(Node node)
    if(node instanceof Node)
    if(node.getNodeName()!=null && (!node.getNodeName().equals("#text")))
    {System.out.println(new String(node.getNodeName()));
                   System.out.println();
    if(node.getNodeValue()!=null && (!node.getNodeValue().equals("#text")))
    {System.out.println(new String(node.getNodeValue()));
                   System.out.println();
    private static void peekAttributes(Node element)
    if(element.hasAttributes())
    NamedNodeMap map = element.getAttributes();
    for(int i=0;i<map.getLength();i++)
    Attr attribute = (Attr)map.item(i);
    peekNode((Node)attribute);}
    //*******************************************************************************************************************

  • Cannot write configuration file

    Hello,
    I have a problem loading up a project I have taken over from some one else. I need some guidance as I can't seem to find the solution. However im not that familiar with .NET or MVS as I once
    was. The message I get is as follows :-
    Microsoft Visual Studio
    Creation of the virtual directory localhost:49623/ failed with the error: Filename: \\?\C:\Users\firstname.surname\Documents\IISExpress\config\applicationHost.config
    Error: Cannot write configuration file
    However I have checked the permissions and can't see anything obvious. Under guidance from another developer I have also updated :-
    www.nuget.org/
    and
    www.nuget.org/packages/Microsoft.AspNet.Mvc
    I am using a Windows 7 enterprise edition Dell Lattitude laptop. With MVS as follows
    Microsoft Visual Studio Professional 2012
    Version 11.0.50727.1 RTMREL
    Microsoft .NET Framework
    Version 4.5.50938
    Installed Version: Professional
    Microsoft Visual Studio Tools for Applications 2012   04938-088-1153812-02395
    Microsoft Visual Studio Tools for Applications 2012
    Office Developer Tools   04938-088-1153812-02395
    Microsoft Office Developer Tools
    Team Explorer for Visual Studio 2012   04938-088-1153812-02395
    Microsoft Team Explorer for Visual Studio 2012
    Visual Basic 2012   04938-088-1153812-02395
    Microsoft Visual Basic 2012
    Visual C# 2012   04938-088-1153812-02395
    Microsoft Visual C# 2012
    Visual C++ 2012   04938-088-1153812-02395
    Microsoft Visual C++ 2012
    Visual F# 2012   04938-088-1153812-02395
    Microsoft Visual F# 2012
    Visual Studio 2012 Code Analysis Spell Checker   04938-088-1153812-02395
    Microsoft® Visual Studio® 2012 Code Analysis Spell Checker
    Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.
    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V.
    All rights reserved.
    Visual Studio 2012 SharePoint Developer Tools   04938-088-1153812-02395
    Microsoft Visual Studio 2012 SharePoint Developer Tools
    NuGet Package Manager   2.8.60318.667
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit docs.nuget.org/.
    PreEmptive Analytics Visualizer   1.0
    Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
    SQL Server Analysis Services  
    Microsoft SQL Server Analysis Services Designer
    Version 11.0.5058.0
    SQL Server Data Tools   11.1.20627.00
    Microsoft SQL Server Data Tools
    SQL Server Integration Services  
    Microsoft SQL Server Integration Services Designer
    Version 11.0.3436.0
    SQL Server Reporting Services  
    Microsoft SQL Server Reporting Services Designers
    Version 11.0.3436.0
    Web Developer Tools   1.0.30710.0
    Microsoft Web Developer Tools contains the following components:
    Page Inspector: Tool that offers an efficient way to decompose Web Applications and diagnose front-end issues.
    Web Publishing: Extensions required for Web Publishing for both hosted servers as well as on premises.
    Web Form Templates: Includes the default templates for Web Form Applications.
    Editor Extensions: Includes HTML, CSS, and JS editor extensions that greatly enhance the development experience.

    I see some others have had success by removing encryption on the IISExpress folder and removing the Read Only attribute as well.
    See this post for details.
    Others have had success by doing the following:
    - Run Command Prompt (cmd) in Admin Mode
    - Enter the following command: DISM /Online /Cleanup-image /Restorehealth
    ...as detailed here.

  • Caching swf per page with document.write

    To solve "click to activate this object", i use
    document.write to put flash files.. But this prevents caching. I
    have "the same" swf files for many items on the page, and browser
    loads that swf, "item" times. And this triggers my Denial of
    Service protection and prevents user from using the site for 10
    secs. Well.. What i need is, using a method that prevents "click to
    activate this object" but that won't flicker the flash files when
    page is loading ( like outerHTML method ), and that allows caches.
    At least, fetching the swf once for a page. Any ideas?

    create needed structure like first case
    what is difference ?
    you have report for one invoice
    A Invoice: 12345in first and second case
    There are variable numbers of sub areas in a business unit and variable numbers of orders per sub area.do you need some formatting?
    I need to create a max number of rows per page in the detail area but there are variable numbers of detail groups and lines.what is logic for getting max number of rows?
    can you post more info with sample xml structure and sample output plz?

  • Writing XML Document to a file or the console

    How do i write an XML document to a file & to the console.
    Document doc = new Document
    doc = (Document)Class.forName("org.apache.xerces.dom.DocumentImpl").newInstance();
    Element root = doc.createElement("PERSON");
    Element item = doc.createElement("NAME");
    item.appendChild(doc.createTextNode("Vaskar"));
    root.appendChild(item);
    How do i write this doc object to the console

    if you use XMLDocument object which implements Document then you would be able to use the method print that is part of the xmlDocument class
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Vaskar Dasgupta ([email protected]):
    How do i write an XML document to a file & to the console.
    Document doc = new Document
    doc = (Document)Class.forName("org.apache.xerces.dom.DocumentImpl").newInstance();
    Element root = doc.createElement("PERSON");
    Element item = doc.createElement("NAME");
    item.appendChild(doc.createTextNode("Vaskar"));
    root.appendChild(item);
    How do i write this doc object to the console<HR></BLOCKQUOTE>
    null

  • Document.write in Portal?

    This is a continuation of an issue I posted in a previous thread.
    My college's Portal home page displays a pagelet containing a Flash animation that provides rotating content for students, such as news about registration, ongoing contests, etc. Because not all browsers support Flash, I've been tasked with writing some javascript that will detect whether Flash is installed, and if not, display a static JPEG image instead. The pagelet was created using the Pagelet Wizard and pulls in a static html file stored on the network. I've embedded the script in that file.
    The script appears to work fine in IE 7. In Opera, the static image is correctly displayed. In Safari, a blank pagelet is displayed. This is also the case in IE 8. No maximization buttons exist in either case. The worst offender is Firefox 3.6. The Flash animation appears outside of the pagelet, up at the upper left corner of the browser.
    I've tried a number of different approaches. The script originally used document.write() to write content to the browser depending on what browser was detected, and whether Flash was installed. That approach never worked reliably in Firefox, so I then created a div element in the static HTML file and used .innerText to write to it. Turns out Firefox has known bugs in the innerText implementation.
    So now I'm reduced to writing a very detailed browser sniffer that detects specific user agents and their versions, and then executes different Flash-replacement approaches per each. My question is therefore a variation on the usual one: Has anybody encountered this kind of problem before, and does a known fix exist? Once I come up with something that works, I can post the results here for everybody's edification. But it would be nice if such an animal already is out there somewhere.

    Hi,
    please add this step:
    2b. Click on the oc4j-container (like home or oc4j_soa or ...) where you want to deploy the portal...

  • Getting "Unable to write cache file" message in DW CS4

    I was having some issues with a Javascript message, so looking for possible solutions, I came across “Deleting a Corrupted Cache File” in the Index to Dreamweaver FAQ located on this forum. I decided to give it a shot and carefully followed the instructions on my Windows XP, deleting the suggested cache file in my Configuration folder. That didn’t help make my Javascript message go away, though I did eventually find a work-around for that issue.
    However, after deleting this cache file, I began to get the following message every time I close my program or change sites in local files, “Unable to write cache file ‘C:\Documents and Settings\...” the message ends with the site name and the extension .dws.  If I go to Manage Sites and turn off the Enable Cache button for that particular site, I no longer get the message. But if I turn the Enable Cache Button back on, I get the message again. It gives this same message for all the sites.
    I’m hoping others have had this issue and there is a simple fix. I can’t say for sure that deleting the cache file in the configuration folder caused this, but it was only after that I began noticing the problem, so it would make sense the two are likely related.
    Also, I wonder how important the cache is. I could just turn off the Enable Cache Button for all the sites as a work-around if there's no quick fix and if it’s no big deal.
    -Steve

    I was having some issues with a Javascript message, so looking for possible solutions, I came across “Deleting a Corrupted Cache File” in the Index to Dreamweaver FAQ located on this forum. I decided to give it a shot and carefully followed the instructions on my Windows XP, deleting the suggested cache file in my Configuration folder. That didn’t help make my Javascript message go away, though I did eventually find a work-around for that issue.
    However, after deleting this cache file, I began to get the following message every time I close my program or change sites in local files, “Unable to write cache file ‘C:\Documents and Settings\...” the message ends with the site name and the extension .dws.  If I go to Manage Sites and turn off the Enable Cache button for that particular site, I no longer get the message. But if I turn the Enable Cache Button back on, I get the message again. It gives this same message for all the sites.
    I’m hoping others have had this issue and there is a simple fix. I can’t say for sure that deleting the cache file in the configuration folder caused this, but it was only after that I began noticing the problem, so it would make sense the two are likely related.
    Also, I wonder how important the cache is. I could just turn off the Enable Cache Button for all the sites as a work-around if there's no quick fix and if it’s no big deal.
    First of all, only delete cache files when DW is shutdown.
    Also, there are a few different caches. That article only addresses 1 of them. Take a look at this TechNote to be able to find the Site .dws cache files:
    http://kb2.adobe.com/cps/598/5989f7f4.html
    HTH,
    Randy

  • How to write into file from xml dom Object

    Hello,
    I try to transform my xml DOM document object into
    file. I try the following:
    try {
              // Prepare the DOM document for writing
              DOMSource source = new DOMSource(newDoc);
              // Prepare the output file
              File file = new File(myHomeRep + "btLom.xml");
              StreamResult result = new StreamResult(file);
              // Write the DOM document to the file
              Transformer xformer = TransformerFactory.newInstance().newTransformer();
              xformer.transform(source, result);
              } catch (TransformerConfigurationException e) {
              } catch (TransformerException e) {
    But my file is empty.
    I do it with some wel formed xml tree document, thus I am certain
    that the xml tree exists.
    Could you explane me please what I am doeing wrong,
    or is there are some possibility to make from my xml dom object
    a file.
    In advance much thanks,
    Julia

    Here's one thing you are doing wrong:} catch (TransformerConfigurationException e) {
    } catch (TransformerException e) {
    }With this code, if an exception occurs then you are guaranteed to know nothing about it. At the minimum do this:} catch (TransformerConfigurationException e) {
      e.printStackTrace();
    } catch (TransformerException e) {
      e.printStackTrace();
    }

Maybe you are looking for

  • General question about data recovery from raid on windows server !

    hi, I like to buy data recovery software for windows server  to recover data with  any raid( or whitout raid so the company tells me you should be sure the Raid can be recognized correctly as local disk drive first, otherwise, our product  wil not he

  • Text Type (short - long) in F4 selection help (web)

    How can I change the the text type (short - medium - long) in the F4 help for a variable on the web? Currently the short text is always displayed and I want to show the medium text. I had the idea the setting 'text type' (in rsa1\infoobject maintenan

  • 5th Gen restarting during sync

    Apple replaced my 30g video today after my old one completely fried. When I connected the new ipod to my computer to load songs, i had a problem iPod connects, iTunes recognizes and displays the inital screen where you choose a name for the iPod. It

  • CHANGING TABLE NAME

    What is the SQL command for changing table name? OR is there any sequence of commands for it. Thanks null

  • Phantom audio in Safari

    When my wife starts Safari on her MacBook Pro she gets audio in the background from what sounds like an old CNN newscast. It is the same report every time, which eventually stops after 10 min or so. We cannot find the file or app that is playing this