Hi, guys. How are you? Would you help me out this, please?
I am trying to update my xml file called testsave.xml.
In my asp file called testsave.asp, some reason, the access to xml file has been
denied. I don't understand why. Basically this source comes from http://www.brinkster.com/CodeBank/ShowSnippet.aspx?n895.
Well, does this line problem???
code:
objXML.save(Server.MapPath("testsave.xml"))
Do you see why??? Both file is sitting in same directory in wwwroot folder.
Many thanks in advance. Cheers.
testsave.xml
--------------------------------------------------------------
<?xml version="1.0"?>
<page>
<title>test</title>
</page>
testsave.asp
--------------------------------------------------------------
[/code]
code:
<%
'This code and the XML are in the db directory (the only R/W directory for Brinkster General Users)
'Load xml
set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = false
objXML.load(Server.MapPath("testsave.xml"))
'Set root object (points to page tag)
set objRoot = objXML.documentElement
'Create and Append the title element under the root (page) tag
set objTitle = objXML.createElement("title")
objRoot.appendChild(objTitle)
objTitle.text = "Hello World!"
'Save xml
objXML.save(Server.MapPath("testsave.xml"))
Set objXML = Nothing
%>
(Edited by Tekapo on 02-07-2005 04:49)