3 Replies Latest reply on Dec 21, 2011 12:20 AM by Darryn Campbell

    Creating XML file on mobile device

    Darrell Ortiz

      Hello,

       

      What is the correct method to create an XML on a mobile device (MC75A) so it can be transmitted via FTP? Here is my code that is not working. Thank you in advance for your assistance

       

        var destfile = "\\app\\transfer\_text.txt";
        var text = "";

        text = "<?xml version=\"1.0\" standalone=\"yes\" ?>\n" +
               "<data>\n" +
               " <code id=\"" + scaninfo + "\">\n" +
               "  <date>" + date + "</date>\n" +
               "  <hour>" + hour + "</hour>\n" +
               "  <minute>" + minute + "</minute>\n" +
                "  <notes>" + notes + "</notes>\n" +
               " </code>\n" +
               "</data>\n";

         try
           {
           var fso, s;
           fso = new ActiveXObject("Scripting.FileSystemObject");
           s = fso.OpenTextFile("C:\\cdm\\transfer\\Logfile.txt" , 8, true);
           s.writeline(text);
           s.Close();
           }
         catch(err)
           {
           var strErr = 'Error:';
           strErr += '\nNumber:' + err.number;
           strErr += '\nDescription:' + err.description;
           alert(strErr);
           }