473,513 Members | 2,537 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using JavaScript(?) to save an XML file

6 New Member
I am working on a project that will locally create XML files. I have an HTML form that uses the Dojo Toolkit and XSLT to create the XML object. Currently I put the XML into a textarea. The used must then copy the XML and paste it into an XML file. I would like for this step to be skipped (i.e. have the XML file created/saved without copying and pasting.)

My idea was to use JavaScript to open a new window, write the XML to that window, and then the user could save the page as an XML file, but the problem with that is either a) the XML tags are not rendered in the new window, or b) when the new window is saved it includes HTML tags.

Does anyone know how I can save the XML to an XML file? Ideally I would just have a button on the original page that would create and save it, but for security reasons I don't think the browser will allow this. Two important constraints are 1) all of the code must be client-side, and 2) the page must work in IE and FireFox. Any ideas?
Oct 17 '07 #1
2 2280
jkmyoung
2,057 Recognized Expert Top Contributor
This is a common request but is not allowed due to security constraints. The javascript would have to be able to save an xml file to the client's computer.

Are either of the constraints relaxable?
Oct 17 '07 #2
dtbrown
6 New Member
Actually I want the file to be saved to the client's computer. The idea with this XML generator tool is that someone would have this HTML (and JS, XSL, etc) file locally, view it in a browser, and save the XML file locally. Since it will not reside on a server all of the code must be able to run on a client's machine. And since the clients will be using PCs and Macs, it must work in both IE and FF. So basically, no, the constraints can't be relaxed.
Oct 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
6395
by: nerf | last post by:
How can I execute a javascript file(test.js) from within PHP. I'm running oscommerce and want to insert a menu created in javascript by Sothink DHTMLMenu. Thanks in advance
3
1887
by: Antonio | last post by:
Good Morning, I would want to insert the javascript of google adsense in my site, here it is : <script type="text/javascript"><!-- google_ad_client = "pub-4902392511135327"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_channel ="";
21
18127
by: ryanmhuc | last post by:
I know the subject might be confusing. I am no beginner with javascript but I haven't been able to figure out how to get the javascript file name from code inside the file. So you have an HTML doc with script tag who's source is a javascript file. <HTML> <script src="javascript.js"></script> </HTML> Javascript.js
7
7756
by: moondaddy | last post by:
I want to dynamically create a JavaScript file and cache it on the client for re-use. I know how to write javascript to a web page from the code behind, but I don't know how to actually create a file such as MyNewScript.js and then cache that on the client so all the pages of that session can use it. Can this be done? Thanks --...
8
2109
by: Maverick | last post by:
I want to group all the javascript functions into a file named MiscFunc.js in a asp.net project. ======================================== e.g. In MiscFunc.js function dummyFunc(var1, var2) { alert(var1 + var2); } ========================================
3
1987
by: Angel | last post by:
Is there any way to debug a javascript file that I included in my ASP.net project. or some reason when I call a javascript function in the file from my ASP.NET code I get an error message. now if i strip the entire code or the file and put just an alert the code obviously works. So there is an error somewhere in the javascript code. i do not...
24
1994
by: gizoto316 | last post by:
I was wondering if it was possible to have php code in a javascript file. I have a java file with a bunch of functions on it and I wanted to add one where the action has php code in it. When i initially tried it, it did not work. Is this possible? Is there a special trick?
1
6547
by: anjud | last post by:
I have an external javascript file which contains a global variable - arrNames var arrNames=new Array(); arrNames="FirstName"; arrNames="LastName"; In my html page I had given the path of this external script file as <head> <script language="javascript" type="text/javascript" src="Common.js"></script>
2
2169
by: verci | last post by:
Hi guys, sorry if this seems stupid but I'm a newbie, I'm running Windows XP Pro SP2, IE 7, VS2005, ASP.net 2.0 The problem is that I'm trying to display this news scroller made in a Javascript file(newsscroller.js) in my ASP page, everything works great in a normal HTML page, I can see the scroller just fine, but in an ASP page it just...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4759
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3255
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.