Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 10th, 2007, 10:44 AM
Registered User
Join Date: Apr 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to update a xml file

I am a beginner when it comes to ASP/XML. This is very easy for me in ASP.NET/C# but not so with classic ASP. how to update a xml file. I have tried many things but get nothing Or get a copy of the node I am trying to update. Please help me with an example. I am using classic ASP and VBSCRIPT.

Also I get 'object not found' on my xml file. Here is my code when I try to save it or display it as .xml I get the error msg. Any help will be much appreciated. The XML is in a hidden form.

           Set clientSideXMLDoc2 = Server.CreateObject( "Microsoft.XMLDOM" )
         // load the xml that is in a hidden form
        clientSideXMLDoc2.load (""form1.txtXML.value"")

        // val = the selected Camp name
          xPath = "//Camp"
          set books = clientSideXMLDoc2.selectNodes(xPath)
          for each book in books
          if (book.selectSingleNode("Camp).text = val ) then
<<<<<<<<< This is where I need to make my update?.

          end if
              clientSideXMLDoc2.save (Server.MapPath("SampleCampaign.xml"))
             If Err.Number <> 0 then
                MsgBox("<br><br>2 There has been an error on change: " & Err.Number & " - " & Err.Description)
                end if
Old April 10th, 2007, 05:49 PM
Friend of Wrox
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher

Try passing this line to a variable

      clientSideXMLDoc2.load (""form1.txtXML.value"")

clientSideXMLDoc2.load(variable_goes_here) //no quotes

Old April 11th, 2007, 08:23 AM
Registered User
Join Date: Apr 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks that worked well.

Similar Threads
Thread Thread Starter Forum Replies Last Post
XML update tusharkale SQL Language 0 July 11th, 2008 09:13 AM
Update xml file simultaneously from two .net app rehna General .NET 1 May 9th, 2008 08:33 AM
Force SQL to update the data from an xml file ivanv SQL Server 2005 0 April 23rd, 2007 04:07 AM
update xml file using vbs thesun99 XML 0 March 21st, 2005 02:32 AM
Getting VB.NET to load & update XML file kyma XML 0 March 19th, 2005 04:58 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.