Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 22nd, 2005, 02:49 AM
Registered User
 
Join Date: Apr 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't save XMLDoc to a xml file using JScript

Greetings all,

I'm a new member to this group, I'm having a problem with the IXMLDocument's save method and I'm not sure how to fix it.

I have a javascript function SaveToXML in which I'll load existing xml file to msxml2.DOMDocument.4.0 object. Then I added new nodes to Root element of the XMLDoc and I'm trying to save it to the same xml file.

At the end of the script I used the line "alert(xmlDoc.xml)" to see that my XML has been revised (this is for debugging only) and then use the line "xmlDoc.save(filename)". I'm able to see my expected changes in alert but not in xml file on disk.

The problem here is XMLDoc.Save(filename) is not intended for use from a secure client, such as Microsoft® Internet Explorer. I can able to save to file from View mode in Visual Studio InterDev 6.0. Can anybody help me to save xml file using JScript and DOM without using Server objects. I put security level to low for IE 6.0 on my work station.

I am trying to do a simple GuestBook for my site using XML, almost finished this except for this problem, If anyone out there can help me with this, I would greatly appreciate:) it.

 
Old April 22nd, 2005, 08:45 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If the site is added to the "Trusted Sites" zone and activex permissions are all set to "Enable" or "Prompt" then this will work. Of course you cannot make the users set their machines up this way unless you are running an intranet or the like.

--

Joe (Microsoft MVP - XML)
 
Old May 13th, 2005, 02:44 PM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

The bottom line is that, in general, you can't use the save functionality for an XML document from browser JavaScript.

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Save database schema to XML file brettk_1 General .NET 2 September 16th, 2006 04:27 AM
How to create and Save an Xml file at client side. kiranvsamuel XML 1 June 30th, 2006 05:26 AM
save word formfields into an xml file manjugv Word VBA 0 May 1st, 2006 04:44 PM
How to save XML file using JScript/DOM in IE induriprakash XML 2 April 26th, 2005 07:37 AM
xmlDoc.save Permissions mhpadgett XML 1 June 19th, 2003 09:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.