Click to See Complete Forum and Search --> : Saving XML using XMLDOM gives errors


praveeng78
April 16th, 2003, 10:17 PM
I am trying to save an XML document by calling the save method on an XMLDOM object. However the save method call fails. I have tried sending in the complete path and also the virtual path but does not work.

Following is the code:

Dim str, xmldoc
Set xmldoc = CreateObject("Microsoft.XMLDOM")
xmldoc.loadXML Request("strXml")
If xmlDoc.parseError.errorCode <> 0 Then
Msg = "The string you entered was not well-formed XML. " & _
xmlDoc.parseError.reason
Else
xmldoc.save(Server.MapPath("saved.xml")) ---- GIVES ERROR
str = Request("strXml")
str = Replace(str, Chr(38),"&", 1, -1, 1)
str = Replace(str, Chr(34),""", 1, -1, 1)
str = Replace(str, Chr(46),".", 1, -1, 1)
str = Replace(str, Chr(60),"&lt;", 1, -1, 1)
str = Replace(str, Chr(62),"&gt;", 1, -1, 1)
Msg = "<P>Your XML string:<BR>" & str & _
"<BR>has been saved to the server as <A HREF='saved.xml'>saved.xml</A>.</P>"


Hope someone can help
Thanx.

Satishpp
April 17th, 2003, 12:25 PM
If this is the error you are getting

-----------------------
msxml3.dll error '80070005'

Access is denied.

/tests/xmltest.asp, line 9

--------------------------

All you need to do is give the Internet guest account write permission to your application directory.

Your machine's Internet guest account id will be
IUSR_<your machine name>

give this user write permission to the directory by right clicking on the directory name in windows explorer, go to properties -> security
Select the account and make changes to the access permissions

If your error is not the same, and this does not solve your problem, do let us know

Satish

praveeng78
April 17th, 2003, 05:44 PM
Thanx. I shall try that and get back.