I am currently trying to save an XML data using "SaveAs" execCommand from Javascript in Internet Explorer 8 only.I am using document.write(xml) to write the xml content after i open a window.The document object in IE8 uses a saveAs Exec
Command to allow the user to save the xml file in the local folder.The XML file is generated but it doesnt set the encoding to my preferred type for a different interface where i need to send this XML which is ANSI/UTF-8 encoding.I can only save
the XML in UCS2 little Endian encoding format.Below is the code i am using.
var location = "D:\\export_to_MCT"+dateTime+".xml";
var xml = tmpSelectedConfigurationXML.transformNode(xslDoc);// XML Is generated here
alert(xml);
**var testlink = window.open ("about:blank","_blank","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10000, top=10000, width=10, height=10, visible=none");
testlink.document.write(xml); //fileData has contents for the file
testlink.document.close();
testlink.document.execCommand('SaveAs', false, location);**
testlink.close();
My purpose is to save the xml in ANSI/UTF-8 encoding without BOM format.I cant use Scripting.FileSystemObject method of ActiveX object.Please suggest
var location = "D:\\export_to_MCT"+dateTime+".xml";
var xml = tmpSelectedConfigurationXML.transformNode(xslDoc);// XML Is generated here
alert(xml);
**var testlink = window.open ("about:blank","_blank","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10000, top=10000, width=10, height=10, visible=none");
testlink.document.write(xml); //fileData has contents for the file
testlink.document.close();
testlink.document.execCommand('SaveAs', false, location);**
testlink.close();
My purpose is to save the xml in ANSI/UTF-8 encoding without BOM format.I cant use Scripting.FileSystemObject method of ActiveX object.Please suggest