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?
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?
Comment