Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save XML file with DOM

Status
Not open for further replies.

berian

Programmer
Feb 14, 2001
5
DE
Hi!
I´m writting an application that uses a short XML file to store names and propierties of users:

<list>
<user name=&quot;John Smith&quot;>
<prop1/>
<prop2/>
...
</user>
</list>

Now I need to add more users and saving the new configuration in the same file, where the old was. I do that with DOM in VBScript and works fine until I try to save with the instruction XMLDoc.save(&quot;file.xml&quot;)
I´ve tried to do that throug remote scripting (running the funtion in an ASP file and calling it from the HTML page), but it doesn´t work.

Could anyone give me some new idea?

Thanks a lot!!
 
Hi.

Try,

XMLDoc.save(Server.MapPath(&quot;file.xml&quot;))

regards, Kirilla
 
Hi Kirilla.

I´ve had already tried that, and it doesn´t works. Thanks anyway.

Berián
 
Hi.

Could you send me your source or some detailed information about your client and server side script?

regards, Kirilla
 
Hi Berian,

I am also facing the same problems of trying to save an xml document after making some changes to it using VBscript and DOM, could you let me know about your findings.

Thanks and regards,
-Amit
 
Hi.

In server side script that run in ASP page you should use the server object to save an xml document, 'cause it has the neccessary privilages to save an file on the server.

exam.:

<Script Language=&quot;VBScript&quot; RUNAT=&quot;SERVER&quot;>

dim xmlDoc
xmlDoc=Server.CreateObject(&quot;Microsoft.XMLDOM&quot;) //it's an older version of DOMDocument. for updates see Microsoft updates MSXML3.0
//any changes ....

xmlDoc.save(Server.MapPath(&quot;myXML.xml&quot;))

</Script>

regards, Kirilla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top