PDA

View Full Version : updating value of particular nodes in xml file through asp.....!!!!


wanye
10-03-2002, 08:50 AM
hi all, i need help on updating value of particular nodes in xml file through asp.... for example i have 5 input field for which each field correspond to a particular node in xml....
after i enter text to each of these field and click on submit button... a new xml file will be created wif these tags inside..

My prob is :
after the xml file is created, what if i just want to update the value of a particular node while other nodes remained unchanged
on clicking a button other than submit just to change value of that particular node. how to do that??

how should i do the form ?? is there a method to put a button eg."update" beside each input field ...and when i wanted to update a particular node...i juz need to input text to that particular field and click on the "update" button.... only that particular node value will be updated...while other node values remained unchanged..... i need help on that badly......THX!!!!

gajra
10-03-2002, 09:45 AM
hope u have any key value for every node u would like to update.


so use the foll. code


Dim xmlDoc As New Msxml2.DOMDocument
Dim currNode As IXMLDOMNode
xmlDoc.async = False
xmlDoc.Load ("books.xml")
Set currNode = xmlDoc.documentElement.selectSingleNode("//book")
MsgBox currNode.Text


replace books.xml to ur file name
"//book" to ur key value to be used for selecting that node alone.

after u get that node u can access all of its attributes.

wanye
10-03-2002, 03:06 PM
hi. gajra ....can show me a more detail example on using .foll code??

gajra
10-04-2002, 05:10 AM
Pls attach ur code which generates xml so that i can see the xml structure and give u proper solution working itself