Writing to XML

I am trying to update value of a xml node. below is the code -
      <fx:Declarations>
            <s:HTTPService id="srv" url="comVars/userInfo.xml"/>
      </fx:Declarations>
      <fx:Script>
            <![CDATA[
                  import flash.net.*;
                  public var userInfo:XML;
                  public var url:URLRequest;
                  public var loader:URLLoader;
                  public function skipPwd():void{
                        url = new URLRequest("comVars/userInfo.xml");
                        loader = new URLLoader(url);
                        loader.addEventListener(Event.COMPLETE, skipPwd2);                     
                  public function skipPwd2(event:Event):void{
                        if(loader.data){
                              userInfo = XML(loader.data);
                        userInfo.replace("pwdSet", <pwdSet>Skip</pwdSet>);
            ]]>
      </fx:Script>
                <s:Button x="642" y="283" label="Skip Pwd" click="skipPwd()"/>
Can someone tell me whats going wrong here? Or i need to approch another way?
Thanks,
Vaibhav

If your question is about writing XML in AS3, here is an example:
var xml:XML = <root></root>;
var node:XML;
var node1:XML;
for (var i:int = 0; i < 4; i++) {
     node = <level1/>;
     xml.appendChild(node);
     for (var j:int = 0; j < 3; j++) {
          node1 = <level2/>;
          node1.appendChild("text " + i + " " + j);
          node.appendChild(node1);
trace(xml);
Documentation is here:
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/XML.html
kglad has covered server side aspect.

Similar Messages

  • XML Forms - Data model - writing to XML or Doc property

    Hi,
    Can someone please explain how user data inputted into an XML Form is stored?  I understand how it is stored in XML format, but am a little lost with SDN help doco, below:
    "Data Model
    The data model is a structured description of the data that is stored in XML forms. The data that you enter in forms is written in either an XML file or in properties of documents. A combination of the two is also possible."
    (link: http://help.sap.com/saphelp_nw04/helpdata/en/8f/fe743c74fa6449e10000000a11402f/frameset.htm)
    What does "properties of documents" refer to?  Is this an existing document? A new KM resource (not of type XML)? Or is this document property of the XML file being created?
    Also, does ALL user input from a form need to be stored as XML files, rather than an XML file or some other resource type?
    Many thanks,
    Justin

    Hello Justin!
    >
    Justin Hume wrote:
    > What does "properties of documents" refer to?  Is this an existing document? A new KM resource (not of type XML)? Or is this document property of the XML file being created?
    >
    Look at this you wrote  "The data that you enter in forms" - writing in "properties of documents"  - it means that you can do some changes with KM files from XML forms, or you can administrate (approve doc. and so on).. So all property will be change in KM doc - wich you customize from XML form
    >
    Justin Hume wrote:
    > Also, does ALL user input from a form need to be stored as XML files, rather than an XML file or some other resource type?
    >
    Only XML (if use XML Form Builder)

  • HOWTO: Writing Out XML Query Results of Any Size in Java with XML SQL Utility

    A customer mailed me asking for an example of how to use our XML SQL Utility to write out query results for tons of query result rows.
    With tons of data, the getXMLDOM() and getXMLString() methods are not really appropriate due to the size.
    The XML SQL Utility offers a getXMLSAX() method that streams SAX2 events to report the data being queried. This is the approach we can use to handle data of any size.
    It dawned on me today that by putting together the XML SQL Utilities getXMLSAX() routine, and the oracle.xml.parser.v2.XSLSAXPrintDriver SAX2 ContentHandler, we can effectively stream out data of any length to an appropriate writer.
    Here's a code example to get the point across:
    package test;
    import java.io.BufferedOutputStream;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.util.Properties;
    import javax.xml.transform.OutputKeys;
    import oracle.jdbc.OracleDriver;
    import oracle.xml.parser.v2.XSLException;
    import oracle.xml.parser.v2.XSLOutput;
    import oracle.xml.parser.v2.XSLSAXPrintDriver;
    import oracle.xml.sql.query.OracleXMLQuery;
    public class Example  {
      private static final String QUERY = "select * from emp";
      public static void main(String[] args) throws Throwable  {
          Connection conn = getConnection();
          OracleXMLQuery q = new OracleXMLQuery(getConnection(),QUERY);
          // Any printwriter will do. Here's we're output to standard out.
          PrintWriter output = new PrintWriter(new BufferedOutputStream(System.out));
          // This is a SAX2 Content Handler used by the Oracle XSLT Engine
          // to serialize a stream of sax2 events as an XML document
          // We'll use it to serialize the sax2 events from the XML SQL Utility
          // out as an XML document.
          XSLSAXPrintDriver ch = new XSLSAXPrintDriver(output, outputOptions());  
          // This asks XML SQL Utility to fire sax events for the data
          // being fetched instead of creating DOM nodes or returning text.
          // By using the XSLSAXPrintDriver content handler, these events
          // get handled by writing them directly to the output stream
          q.getXMLSAX(ch);
          ch.flush();
          q.close();
          conn.close();     
      private static XSLOutput outputOptions() throws XSLException {
        XSLOutput x = new XSLOutput();
        Properties props = new Properties();
        props.put(OutputKeys.METHOD,"xml");
        props.put(OutputKeys.INDENT,"yes");  // Set to "no" for non-indented
        x.setProps(props);
        return x;
      public static Connection getConnection() throws SQLException {
        String username = "scott";
        String password = "tiger";
        String thinConn = "jdbc:oracle:thin:@localhost:1521:ORCL";
        Driver d = new OracleDriver();
        return DriverManager.getConnection(thinConn,username,password);
    }

    Hi Uber,
    This is a known issue that error occurs when running report "Count of instances of specific software registered with Add or Remove Programs" due to non-printable characters for XML. Based on internal research, the hotfix for this issue will be
    included in the System Center 2012 Configuration Manager Service Pack 1.
    As a workaround, you can remove the nonprintable character populated into the report parameter by referring to the following KB article:
    http://support.microsoft.com/KB/914159
    Hope this helps.
    Regards,
    Mike Yin
    Mike Yin
    TechNet Community Support

  • Writing an XML file using a Servlet

    Hello, I'm trying to code a servlet that receives a POST from a HTTP and output its data to a XML file, the problem is that I get the following error:
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    XML document must have a top level element. Error processing resource 'http://localhost:8080/XMLSender/xmlsend'.
    I don't know what happens, because I'm NOT trying to show the content, just to save it, I post my code here so anyone can help me, please. Thanks in advance.
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class xmlsender extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/xml");
    String cadenanumero = req.getParameter("numero");
    String cadenaoperadora = req.getParameter("operadora");
    String cadenabody = req.getParameter("mensaje");
    String cadenashortcode = req.getParameter("shortcode");
    File f1 = new File("salida.xml");
    FileWriter writer = new FileWriter(f1);
    writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    writer.write("<root>");
    writer.write("<tlf>" + cadenanumero + "</tlf>");
    writer.write("<op>" + cadenaoperadora + "</op>");
    writer.write("<sc>" + cadenashortcode + "</sc>");
    writer.write("<body>" + cadenabody + "</body>");
    writer.write("</root>");
    writer.close();
    }

    Yes, in fact what I want is the file to be in the server, now, I modificated my code to the following:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class xmlsender extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/HTML");
    String cadenanumero = req.getParameter("numero");
    String cadenaoperadora = req.getParameter("operadora");
    String cadenabody = req.getParameter("mensaje");
    String cadenashortcode = req.getParameter("shortcode");
    File f1 = new File ("salida.xml");
    FileWriter writer = new FileWriter(f1);
    /*salida.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    salida.println("<root>");
    salida.println("<tlf>" + cadenanumero + "</tlf>");
    salida.println("<op>" + cadenaoperadora + "</op>");
    salida.println("<sc>" + cadenashortcode + "</sc>");
    salida.println("<body>" + cadenabody + "</body>");
    salida.println("</root>"); */
    salida.println("Finalizado");
    f1.createNewFile();
    writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    writer.write("<root>");
    writer.write("<tlf>" + cadenanumero + "</tlf>");
    writer.write("<op>" + cadenaoperadora + "</op>");
    writer.write("<sc>" + cadenashortcode + "</sc>");
    writer.write("<body>" + cadenabody + "</body>");
    writer.write("</root>");
    writer.close();
    It still do not create my file "salida.xml", still don't know why. Any help is welcome.

  • Writing an XML file from JSP

    Hi
    for some this question will seem to be a stupid, but i am really confused how can i write an XML file from with in JSP code. should i have to use same FileOutPutStream.
    Actually i am trying to make reports using Jasper api. It demands for an XML file which will then b converted into PDF file. Can any one help me in it.

    Jasper converts a JSP into a servlet - and cannot be used to generate PDFs.
    Assuming this is for a web application I would
    1. Generate the XML
    2. Generate the PDF from the XML
    3. Send the PDF to the client from a servlet (i.e. forget the JSP).
    Step 2 is actually quite complicated - you could do this manually with the IText API (http://www.lowagie.com/iText/) or use an XSL approach with Apache FOP (http://xmlgraphics.apache.org/fop/)

  • Writing to XML files need help

    Guys,
    I need to pull out data from the database and write it to multiple flat files in XML.
    I can't do it on the database server using utl_file, I need to do it on the client.
    Can you tell me the best way to achieve it.
    I am giving you a sample plsql that we have built.
    I have to create one file for each deptno.
    Your values suggestions/inputs would be appreciated.
    Dhiren
    declare
    queryCtx dbms_xmlquery.ctxType;
    cursor c1 is select * from dept;
    result clob;
    begin
    for c1rec in c1
    loop
    queryCtx := DBMS_XMLquery.newContext('select .... from emp where deptno = c1.deptno');
    result := DBMS_XMLquery.getXML(queryctx);
    DBMS_XMLquery.closecontext(queryctx);
    end loop;
    end;

    use the above pl/sql to generate xml.
    next step would be to create a folder on the xmldb repository.
    this has to be done with SYS user.
    DECLARE
    l_success      BOOLEAN := FALSE;
    l_resourceURL  resource_view.any_path%TYPE := '/public/scott';
    BEGIN
    IF (NOT DBMS_XDB.EXISTSRESOURCE(l_resourceURL)) THEN
         l_success := DBMS_XDB.CREATEFOLDER(l_resourceURL);
         COMMIT;
    END IF;
    END;
    /so now you have your folder as /public/scott under which you can create resources.
    resources in XMLDB is nothing but files.
    so the generated xml can be saved as xml file under the above path.
    to create a resource, you need xmldata and the resource name.
    eg.
    dbms_xdb.createresource('/public/scott/myxml.xml', l_xml_data);
    commit;
    now you can ftp the resource to the client,
    open <server name> 2100
    user scott tiger
    get /public/scott/myxml.xml c:\temp\myxml.xml
    close
    bye
    that's it.
    good luck.
    check the port of the ftp . normally by default it is 2100 unless it is changed by your admin,

  • Problem in writing to XML

    hi all,
    when i add a node to an existing xml file and write to disk, it writes
    <device name="POS1-888887"/><device name="POS2-888887"/><device name="POS3-888887"/>
    My questions is:
    1. How do i make it write in single line
    <device name="POS1-888887"/>
    <device name="POS2-888887"/>
    <device name="POS3-888887"/>
    Here is the code:
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    Source source = new DOMSource(Document d);
    File file = new File(outfilename);
    Result result = new StreamResult(file);
    xformer.transform(source, result);
    Thankyou.

    those two lines,
    xformer.setOutputProperty(OutputKeys.INDENT, "yes");
    xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
    are doing the job of printing in seperate lines. Fantastic!!!!.
    Thanks..

  • Writing generated XML into a file after comparing with other XML

    Hi,
      I have completed the comparison of two XML now I have a requirement to concat these two xml but also need to append the XML with a status node that if after comparing the two XML output is Y or N so if it is Y then a node with
    <status>Y</status>
    <from table>t1</from table>
    then completing those task I need to write it in a file
    declare
        p_emp_info   CLOB;
      l_emp_tab        xmlsequencetype := xmlsequencetype();
    BEGIN
      FOR i IN (SELECT id from emp WHERE emp_name='ABC') LOOP
        l_emp_tab.extend;
        SELECT XMLELEMENT("ABCD",
               XMLELEMENT("id",i.id))
          INTO l_emp_tab(i)
          FROM dual;
    END LOOP;
      SELECT XMLELEMENT("EMP"
                           ,XMLAGG(t.column_value))
        INTO p_emp_info  
        FROM TABLE(l_emp_tab) t;
        --Dbms_Output.put_line(getclobval(1,2));
    EXCEPTION
        WHEN OTHERS THEN
       Dbms_Output.put_line(SQLCODE||sqlerrm);
    END ;
    I am using this query but it is giving me an error that expression is of wrong type  at this line {  INTO l_emp_tab(I) }
    I am unable to find out the error that what I am missing here !!

    You've changed the datatype of i from the example that Odie gave you in
    repeating nodes using FOR loop but when concating XML string then concating only last iteration of FOr loop ??
    In his example, i was a number.  In your above code, i is now the rowset for a cursor.
    You could rewrite your version to look like
    declare
      p_emp_info     XMLTYPE;
      l_emp_tab      xmlsequencetype := xmlsequencetype();
      l_pos          PLS_INTEGER;
      CURSOR c_info IS
        SELECT id
          from emp
         WHERE emp_name='ABC';
    BEGIN
      FOR r_info IN c_info LOOP
        l_emp_tab.extend;
        l_pos := c_info%ROWCOUNT;
        SELECT XMLELEMENT("ABCD",
               XMLELEMENT("id",r_info.id))
          INTO l_emp_tab(l_pos)
          FROM dual;
      END LOOP;
      SELECT XMLELEMENT("EMP"
                           ,XMLAGG(t.column_value))
        INTO p_emp_info 
        FROM TABLE(l_emp_tab) t;
      --Dbms_Output.put_line(p_emp_info.getclobval());
    END ;
    You can't use the c_info%ROWCOUNT in the INTO clause, hence the need for l_pos.
    Or you could rewrite it to be
    declare
      p_emp_info   XMLTYPE;
      l_clob       CLOB;
    BEGIN
      SELECT XMLElement("EMP",
               XMLAgg(XMLElement("ABCD",
                        XMLElement("id",e.id))))
        INTO p_emp_info
        FROM emp e
       WHERE emp_name = 'ABC';
      SELECT XMLSERIALIZE(DOCUMENT p_emp_info AS CLOB)
        INTO l_clob
        FROM DUAL;
      Dbms_Output.put_line(l_clob);
    END;
    Both produce the same XML.

  • ITunes not writing valid XML file

    I've been having trouble with my iTunes library being seen by anything other than itunes (iPhoto, iLike etc) and the problem is with the XML file. If i try to open the xml file in BBEdit i get an error that says:
    *Incorrectly formed UTF-8*
    The UTF-8 File "iTunes Music Library.xml" is damaged or
    incorrectly formed; please proceed with caution.
    So I dump it and force iTunes to create a fresh copy, but that has the same problems.
    If I put an old copy of the XML file (from a few months back) into the iTunes folder, then all the other iApps can see an iTunes library and interact with it, but as soon as iTunes updates the file it becomes unusable again.
    The XML file is 30.5MB.
    Does anyone have even the slightest idea why iTunes is producing an unusable XML file all the time? Could it be something to do with the size of the file? Or could it be something that's appeared in my library over the past few months that's messing up the xml file?
    Any and all comments/suggestion would be greatly appreciated as i'm running out of hair to pull out

    Ok, I ran the rest through my parser, and there is (only) one other broken spot. It's on "Donde Liesta Usc (La Boheme)" Also the file location tag. (Shown as "where" in the summary tab of the info window in iTunes.) Deleting and re-adding this track as well as "Need You Tonight" should cause iTunes to correct those location tags and completely solve the problem by eliminating the character encodings that are illegal for utf-8. Both tracks should then also become playable again.

  • Reading and Writing from XML into database

    Dear all,
    We have a requirement where we have to upload data to FTP location in XML files, and then read from this into our database daily 2-3 times a day.
    We have oracle 11g database, can someone kindly guide me how we can acheive this.
    Also is there any tool for this? my management is thinking of purchasing one if it exists.
    thank you

    user10243788 wrote:
    Thank you miheal,
    is there any tool also we can use?The person I turn to for ideas about XML going into and out of the database is Marco Gralike.
    Here's a sample (a couple of years old now) from his blog of mixing XML and SQL: http://www.liberidu.com/blog/2010/07/29/external-views-xml-based/
    It's the first one I happened to get to when I did a search on his blog for: external table.
    Some time back he sent me an example of running an SQL statement from the database which accessed the internet and pulled back the content of one of my blog pages in a form that would allow me to do: "insert into table select from {XML call}"
    Unfortunately I can't find the code right now - I know I stored it somewhere to make sure I didn't lose it but ...
    Regards
    Jonathan Lewis

  • Writing into XML File in Flex

    Hi,
    I want to create a XML file (dynamically) and writes data
    into that xml file(data coming from web service).
    Thanks in advance.

    i want to write the data(coming from web service) into XML
    file and keep that XML file in Cache,then read that XML file
    contents and post into UI Control(Datagrid).
    <b>Sample Output Data from my Webservice:</b>
    <CoreProgramming>
    <BasicProgramming>
    <ProductId>10049</ProductId>
    <ProgrammingName>America'sTop60</ProgrammingName>
    <Price>29.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>false</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    </Listing>
    </BasicProgramming>
    <BasicProgramming>
    <ProductId>10041</ProductId>
    <ProgrammingName>America'sTop120</ProgrammingName>
    <Price>39.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>true</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DHLTH</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DISC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    </Listing>
    </BasicProgramming>
    <BasicProgramming>
    <ProductId>10045</ProductId>
    <ProgrammingName>America'sTop180</ProgrammingName>
    <Price>49.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>true</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DIY</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>LIME</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    </Listing>
    </BasicProgramming>
    </CoreProgramming>

  • Writing a XML file

    Hello
    I have a question regarding XML.
    First of all, i have a simple Java application. It reads from a text file. The values are comma separated.
    James;54;painter
    Anna;20;teacher
    Joe;32;driverSo my java app creates 3 objects which contain above mentioned information (name, age, occupation).
    Now i need to create a XML file using that same application and it should also hold the above mentioned information . Standard Java API's are allowed.
    Which are my options? How i start? Any hints (besides "search from google)?
    Best Regards

    The SAX parser won't help you in creating XML docs -- only parsing.
    Typically people simply write the XML tags themselves, e.g.:
    String xmlOut = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + "<myclass><name>" + anObj.getName() + "</name></myclass>";
    Axis2 has some methods for generating XML from specially created objects, but it is a lot of work. I hear XMLBeans also has some methods for this, also a lot of work. Which is why most people fall back to the not very elegant method above.

  • Writing xml file, midp, kxml - any ideas?

    Hello,
    Does any have sample code of writing an XML file with kXML or a similar tool?
    I'm getting confused with OutputWriter being abstract/DataOutputWriters not working.
    My code as follows is fairly non-existent..
    OutputStream out = "test.xml"; // this errors with incompatible type (obviously) but what needs to go here?
    XmlWriter fxml = new XmlWriter(out);
    thanks in advance
    poncenby

    OutputStream out = "test.xml"this cant work. the latter is a string and the former an OutputStream.
    yeah, thats pretty strange with the input and output of kXML. What you have to do is:
    1) write a class, that extends the java.io.OutputStream. To do this, you have to implement all abstract methods of this (afaik write(byte))
    2) this class can you pass to the XmlWriter. The most simple way of writing the bytes is to append it to a string, which you reference afterwards.
    public class MyOutputStream extends OutputStream
    public String output = "";
    public void write(int b)
      output += (char)b;
    }then write the stuff out and get the output of your OutputStream class. For writing this to a file (whichis not possible with J2ME, you have to some file handling in your OutputStream, like opening, appending and closing)
    Note: this works only, if the content consists of characters. If you want to write binary data, this will get corrupt, since the cast to char transforms this binaries to characters. The reverse is (afaik) not possible.
    hth
    Kay

  • Writing XML file using javax.xml package

    I am writing an XML file with the foll piece of code:
    public static void writeXmlFile(Document doc, String filename) {
    try {
    // Prepare the DOM document for writing
    Source source = new DOMSource(doc);
    // Prepare the output file
    File file = new File(filename);
    Result 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) {
    In this case above, the whole Document has to be passed to create a new DOMSource. is there any way where in I can pass the individual Nodes to the DOMSource ?
    I want the Nodes to be written one by one as writing the whole document is giving me a OutOfMemoryError (I have about a million records to be written in the XML file).
    Any help would be greatly appreciated

    I am writing an XML file with the foll piece of code:
    public static void writeXmlFile(Document doc, String filename) {
    try {
    // Prepare the DOM document for writing
    Source source = new DOMSource(doc);
    // Prepare the output file
    File file = new File(filename);
    Result 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) {
    In this case above, the whole Document has to be passed to create a new DOMSource. is there any way where in I can pass the individual Nodes to the DOMSource ?
    I want the Nodes to be written one by one as writing the whole document is giving me a OutOfMemoryError (I have about a million records to be written in the XML file).
    Any help would be greatly appreciated

  • How do i add a newline or carriage return to make my xml file look pretty?

    Hi guys
    I'm writing an xml file with jsp, the problem is, it writes it in one big chunk of text. e.g.
    <start>hello, my name is joe</start><middle>I like trees</middle><end>boo</end>
    Now what I want to do is present this xml file in a decent manner,
    e.g.
    <start>hello my name is joe</start>
    <middle>i like trees</middle>
    <end>boo</end>
    i've tried
    xmlFile = "<start>Hello my name is joe</start>"+\n\r;
    and
    xmlFile ="<start>Hello my name is joe</start>"+"\n\r";
    neither work, can anyone provide me with some insight into how I can add a carriage return / new line to make my xml file look pretty?
    Many thanks for any responses!

    u r right <BR> tag will not work...
    I wrote following code to generate xml file and it works fine...U can try the same...
    try
    FileOutputStream fos = new FileOutputStream("c:\\temp.xml");
    String xmlString = "<root>\n<start>Hello my name is joe</start>"+"\n";
    xmlString = xmlString +"<middle>blah blah</middle>\n</root>";
    fos.write(xmlString.getBytes());
    fos.close();
    fos = null;
    catch(Exception e)
    e.printStackTrace();
    }

Maybe you are looking for

  • How to open a file with a link ?

    I am using servlets to design an application. The application supports uploading and downloading of .DOC and .RTF files. My problem is that I am opening an uploaded file via a link. OPen File The above is also working fine and opens the file in the I

  • Another Spotlight Doesn't Work Thread

    OK I've been told I should start a thread with my specific Spotlight problem. So... the story so far. Spotlight is broken on my Mac Book Pro. I don't remember exactly when it started but I get junk in search results, for example: http://www.btinterne

  • Metadata identifying a person in a photo

    In the olden days, family photos went in a shoe box, and if you were lucky, someone wrote on the back of it to tell you who was in the photo. If nobody did that, chances are that a priceless old family photo would eventually become a worthless photo

  • How does Website Storage Settings Panel work?

    I was trying to play a game on facebook and was having trouble. Facebook gave me the link here to the Website Storage Settings Panel and told me to delete all sites. When I get the page the website storage settings  panel is flickering. I never see a

  • [SOLVED]Firefox 21 swedish locale settings not working.

    Firefox does not recognize my swedish locale settings after updating today. Is it just me or is it a bug? I have  "firefox-i18n-sv-se" installed. Last edited by cecar (2013-05-14 20:44:45)