index > Internet Explorer Web Development > XML DOM using JavaScript

XML DOM using JavaScript


Hi everybody how r u?

Actually i am really in big trouble for very small problem i guess.

I am manipulating a xml file using xml dom using javascript, after manipulating the dom tree internally, when i tried to save the file i am getting "permission denied" error. I have tried saving file locally as well remotely.

since my code is little big, i am giving u a dummy example.

var xmlDoc1 = new ActiveXObject("Msxml2.DOMDocument.4.0");

var str = "<Root></Root>";

xmlDoc1.loadXML(str);

var path = "C:\\1.xml";

xmlDoc1.save(path);

for this also i am getting error.

Thanks a lot.




Dig
Digamber

Hi Digamber,

MSXML's security scheme is based on Internet Explorer's security zone settings. You will get this message if you are trying to access data in a more trusted zone from a less trusted zone.

For a complete description of what happens when your script tries to access data across zones / protocols please refer to - http://windowssdk.msdn.microsoft.com/en-us/library/ms762300.aspx

Thanks
Kaushik




SDE | JavaScript Runtime
KaushiS

HI, tried what u said, but the problem is still there......

I am using this solution for one of problem where i have to actually giving functionlity of swaping rows of table by user hitting a button like moveUp or MoveDown.

Can i accomplish this using HTML dom or any solution....




Dig
Digamber

Hi Dig.

first of all, i've encountered a similar problem in the past, and the only file-type that didn't cause errors was text, (regardless of what file-extension i used in the 'SavaAs' file-name).

it's possible your DOM object is viewed as 'object' and needs to be converted to text

you can try writing the xml into an iframe and then use:

<iFrameID>.document.execCommand('SaveAs', false, '[<path>/]<fileName>');

(as text/html type it shouldn't create security issues with javascript or the browser)

maybe i'm misreading your needs here, but if you are trying to reshape a web page using client side script why do you need to save the file? and if it's not a web-page you're attempting to manipulate, why use JavaScript?

anyway - if all you need is to swap rows in a 2D-table on a web page - another possible solution would be to swap the contents between table rows instead of rearranging them, i.e. - swapping whole rows' innerHTML, (primitive, but effective).

Mosis L.
reply 4

You can use google to search for other answers

 

More Articles

• IE 7 Frameset Resize Bug
• CSS Help..
• Iframe Cookie and Https
• Is there a profiling tool for IE rendering times?
• Clean Access Agent
• How to make IE Mobile full screen from script in the page?
• Message asking if allow or block IE7 to use clipboard
• Content advisor bugs in IE6
• IE 7 RC1 dynamic script in showModalDialog
• Knowing when people print using the browser
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

• Using outlook functions in a web-page
• File upload problem
• Stopping IE from getting keystrokes
• IE7 Problems Within Outlook Express 6
• The issue of 'Zoom' of 'Page'
• WebBrowser control modifies HTML entitie
• IE 7.0 + DWebBrowserEvents2
• XML DOM using JavaScript
• download file error
• IE7 Warning on document.location.reload()!
• Idea for IE7
• Div Tag with height in style overlaps HT
• Content advisor bugs in IE6
• My php download script does not work any
• Scaling a web page to print on 8.5 by 11

Hot Articles

• Will IE 7 supports Q tag/element?
• Web Browser inside a tabbed page flicker
• desktop screen record
• My php download script does not work any
• Welcome
• Enbedded Controls
• Tabbed View Src Idea
• Set up cannot locate browsers plug in di
• "The Web page you are viewing is tr
• How to register an HTA as a trusted appl
• Help
• Image not being displayed ("Not fou
• IE7 problem with frame and base target
• IE 7.0 + DWebBrowserEvents2
• keep System.Security.SecurityException f

Recommend Articles

• Outlook Objects and Z-Index
• Help
• How to change the security settings of I
• css: How to colorize the border around a
• XML DOM using JavaScript
• IE7 and desktop icons
• make website resolution independent
• IE7 problem with frame and base target
• IE7 Warning on document.location.reload()!
• Cannot open IE to solve error message
• IE7 RC1 Installation error
• IE7 RC1: open XML doc with window.open
• IE ver 6: Controlling Panels
• How to register an HTA as a trusted appl
• invoking download dialog box upon clicki