p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > XML > XML
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 10th, 2007, 11:44 AM
Registered User
 
Join Date: Apr 2007
Location: , , .
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?.
          MsgBox(val)

          end if
          Next
              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)
                Error.Clear
                end if
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old April 10th, 2007, 06:49 PM
Friend of Wrox
Points: 1,343, Level: 14
Points: 1,343, Level: 14 Points: 1,343, Level: 14 Points: 1,343, Level: 14
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Jul 2006
Location: , , .
Posts: 366
Thanks: 8
Thanked 0 Times in 0 Posts
Send a message via Yahoo to bonekrusher
Default

Try passing this line to a variable

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

clientSideXMLDoc2.load(variable_goes_here) //no quotes




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old April 11th, 2007, 09:23 AM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks that worked well.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XML update tusharkale SQL Language 0 July 11th, 2008 10:13 AM
Update xml file simultaneously from two .net app rehna General .NET 1 May 9th, 2008 09:33 AM
Force SQL to update the data from an xml file ivanv SQL Server 2005 0 April 23rd, 2007 05: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



All times are GMT -4. The time now is 04:21 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc