Solved

Write into xml file

Posted on 2002-07-24
6
261 Views
Last Modified: 2010-08-05
I'm trying to save structure in xml file

<script language="JavaScript">

function writeXML()
{

var oXML = new ActiveXObject("Microsoft.XMLDOM");
var oRoot = oXML.createNode("element", "customers", "");
oXML.appendChild(oRoot);
var oNode = oXML.createNode("element", "customer","");
oRoot.appendChild(oNode)
var oNode2 = oXML.createNode("element", "order","");
oNode.appendChild(oNode2)

oXML.save("prices.xml");

}
     </script>

In result i got error:
"Permission Denid"

Even I remove xml file, still I have this error, even i specify physical path.
0
Comment
Question by:dik_sychev
6 Comments
 
LVL 10

Expert Comment

by:zvonko
ID: 7175504
You have to set "Accessing Data Across Domains" to "enable"
Look here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmconxmlclientsecurity.asp

0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7176716
If it is done clientside you won't be able to. Change the file into an .hta file.

CJ
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7191499
Hello,

try this:
<html>
<script language="JavaScript">
function writeXML()
{
var oXML = new ActiveXObject("Microsoft.XMLDOM");
var oRoot = oXML.createNode("element", "customers", "");
oXML.appendChild(oRoot);
var oNode = oXML.createNode("element", "customer","");
oRoot.appendChild(oNode)
var oNode2 = oXML.createNode("element", "order","");
oNode.appendChild(oNode2)
alert(oXML.xml)
   var fso = new ActiveXObject("Scripting.FileSystemObject");
   var MyFile = fso.CreateTextFile("c:\\prices.xml", true);
   MyFile.Write(oXML.xml);
   MyFile.Close();
}
writeXML();
</script>
</html>

Good luck,
zvonko

0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 12

Expert Comment

by:ahosang
ID: 8330367
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or so. I appreciate any comments that would help me to make a recommendation.
 
In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care
 
ahosang
0
 
LVL 12

Expert Comment

by:ahosang
ID: 8528013
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
ahosang
EE Cleanup Volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8627061
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add Clickable Links to Google Map Markers 3 27
Capture logon name 13 70
Where is java script information saved? 2 50
Web forms being filled out by bots 4 31
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now