Client-Side Xml/Javascript issue 
Author Message
 Client-Side Xml/Javascript issue

Ok, here's the deal.

Trying to modify an XML file on the client. I'm using an XSL sheet to
transform to HTML, write out the form data, etc.
They change their info, hit the "Save" button, and I build the new XML using
the MSXML parser.

All this works great, right up until I try to save the XML file back out.
The save() method is returning Permission Denied errors. I can accept that
maybe Javascript won't let me write out files on the client. Does anyone
either have a workaround or an alternative method for saving the data? We
tried creating an ActiveX control, but it requires signing I think, so it's
not working either. Below is a snippet of my Javascript code...any advice is
welcome. Thanks.

<SCRIPT LANGUAGE="JavaScript">
  <!--
   function ModifyXML()
   {
    //Load the XML file
    var oXMLDomNode = new ActiveXObject("Microsoft.xmldom");
    oXMLDomNode.load("myfile.xml");

    //Loop through the form and build the xml
    for(var i = 0; i < document.forms[0].elements.length; i++)
    {
        ...
    }

    oXMLDomNode.save("myfile.xml");
   }
  //-->
  </SCRIPT>

I've tried it with the full path and without the full path. Nothing seems to
matter. I've tried setting permissions on the local file, but I'm not even
sure which account is being used. I assume the logged on account (running
Windows NT Server 4.0), which does have Full Control on the file.

Thanks again...



Tue, 18 Mar 2003 03:00:00 GMT  
 Client-Side Xml/Javascript issue

Run your html code as a *.hta file, which will allow writing the file

--

Mark L. Ferguson    Reply Only in Newsgroup
marfer's notes for OE 5.0 > http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:

> Ok, here's the deal.

> Trying to modify an XML file on the client. I'm using an XSL sheet to
> transform to HTML, write out the form data, etc.
> They change their info, hit the "Save" button, and I build the new XML using
> the MSXML parser.

> All this works great, right up until I try to save the XML file back out.
> The save() method is returning Permission Denied errors. I can accept that
> maybe Javascript won't let me write out files on the client. Does anyone
> either have a workaround or an alternative method for saving the data? We
> tried creating an ActiveX control, but it requires signing I think, so it's
> not working either. Below is a snippet of my Javascript code...any advice is
> welcome. Thanks.

> <SCRIPT LANGUAGE="JavaScript">
>   <!--
>    function ModifyXML()
>    {
>     //Load the XML file
>     var oXMLDomNode = new ActiveXObject("Microsoft.xmldom");
>     oXMLDomNode.load("myfile.xml");

>     //Loop through the form and build the xml
>     for(var i = 0; i < document.forms[0].elements.length; i++)
>     {
>         ...
>     }

>     oXMLDomNode.save("myfile.xml");
>    }
>   //-->
>   </SCRIPT>

> I've tried it with the full path and without the full path. Nothing seems to
> matter. I've tried setting permissions on the local file, but I'm not even
> sure which account is being used. I assume the logged on account (running
> Windows NT Server 4.0), which does have Full Control on the file.

> Thanks again...



Tue, 18 Mar 2003 03:00:00 GMT  
 Client-Side Xml/Javascript issue

That worked out great. Thanks for the help.


Run your html code as a *.hta file, which will allow writing the file

--
link to FAQ for OE 5.5

Mark L. Ferguson    Reply Only in Newsgroup
marfer's notes for OE 5.0 >
http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:
> Ok, here's the deal.

> Trying to modify an XML file on the client. I'm using an XSL sheet to
> transform to HTML, write out the form data, etc.
> They change their info, hit the "Save" button, and I build the new XML
using
> the MSXML parser.

> All this works great, right up until I try to save the XML file back out.
> The save() method is returning Permission Denied errors. I can accept that
> maybe Javascript won't let me write out files on the client. Does anyone
> either have a workaround or an alternative method for saving the data? We
> tried creating an ActiveX control, but it requires signing I think, so
it's
> not working either. Below is a snippet of my Javascript code...any advice
is
> welcome. Thanks.

> <SCRIPT LANGUAGE="JavaScript">
>   <!--
>    function ModifyXML()
>    {
>     //Load the XML file
>     var oXMLDomNode = new ActiveXObject("Microsoft.xmldom");
>     oXMLDomNode.load("myfile.xml");

>     //Loop through the form and build the xml
>     for(var i = 0; i < document.forms[0].elements.length; i++)
>     {
>         ...
>     }

>     oXMLDomNode.save("myfile.xml");
>    }
>   //-->
>   </SCRIPT>

> I've tried it with the full path and without the full path. Nothing seems
to
> matter. I've tried setting permissions on the local file, but I'm not even
> sure which account is being used. I assume the logged on account (running
> Windows NT Server 4.0), which does have Full Control on the file.

> Thanks again...



Sun, 23 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. pass server side vbscript to client side javascript

2. Calling client-side javascript function from server-side vbscript

3. Calling client-side javascript from server-side vbscript

4. Client Side Objects Performance Issues

5. Client-side vbscript to process XML DOM

6. XML results paging on client side

7. Client side XML/XSL/DOM in IE

8. Accessing Session Variables from Client side Javascript

9. Accessing form elements and querystrings in client-side javascript

10. Encrypt Client Side JavaScript

11. sending variants from VBscript to JavaScript (client side)

12. Client Side Scripting - VBScript or JavaScript?

 

 
Powered by phpBB® Forum Software