XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old November 7th, 2003, 12:30 AM
webgeekinva's Avatar
webgeekinva webgeekinva is offline
$ignorance == $bliss
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Southeast Virginia
Posts: 41 webgeekinva User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to webgeekinva Send a message via Yahoo to webgeekinva
Saving files with MSXML DOM

Hi all,

I've looked around here and some Google searches, and I haven't found an answer yet.

I know you can load an XML file into memory and make changes to the information from that file. Is it then possible to save those changes back to the file? I found one mention of save() but that seemed to be in reference to ASP. I'm doing this all on the client-side (specifically, with an HTML Application.) The environment is Windows 2000.

Thanks.

-michael
__________________
In the beginning, the universe was created. This made a lot of people very angry, and has been widely regarded as a bad idea.

-- Douglas Adams, The Hitchhiker's Guide to the Universe.

Reply With Quote
  #2  
Old November 7th, 2003, 06:32 PM
teedee teedee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 42 teedee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
The save() method will work in a HTA file but trying it in a HTML just brings up a "Permission denied" error.

Code:
      <script type="text/javascript">
      	var oXMLDoc=new ActiveXObject("Microsoft.XMLDOM");
      	oXMLDoc.async=false;
      	oXMLDoc.loadXML("<TEST/>");
      	oXMLDoc.save("output.xml");
      </script>


Remember that the HTA will save the XML on the client machine, not on the web server. If you want it saved on the server then you'll need to use ASP:
Code:
Dim oXMLDoc
Set oXMLDoc=Server.CreateObject("Microsoft.XMLDom")
oXMLDoc.async=False
oXMLDoc.loadXML("<TEST/>")
oXMLDoc.save (Server.Mappath(".") & "\output.xml")


If the server has a newer version of MSXML installed then you're better off using Server.CreateObject("MSXML2.DomDocument"), Microsoft.XMLDOM doesn't support funky stuff like MSXML2.FreethreadedDomDocument, XSL variables and XSL parameters

Last edited by teedee : November 7th, 2003 at 06:38 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Saving files with MSXML DOM


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway