|
-
Aug 1st, 2004, 07:14 PM
#1
Thread Starter
Fanatic Member
updating records in xml file
I need to load an xml file using vb.net, and replace some values with whatever I need too. Then save this xml file again for further use.
Any tutorial or point in the right direction would be awsome!
Thanks!!
-
Aug 1st, 2004, 11:38 PM
#2
Addicted Member
I recommend the use of XPaths to navigate thru the document to update certain record, and use the XmlDocument class a representation of the document.
Plenty of info via Google and MSDN on these.
-
Aug 2nd, 2004, 11:46 AM
#3
Thread Starter
Fanatic Member
Great! I figured out though...
how to load the xml document, and I can change Items in the xml as long as i know the index of the item. Using this...
Code:
Private Sub xmlChange()
Dim DS As New DataSet()
DS.ReadXml("c:\inetpub\wwwroot\xmlTest\xmlemp.xml")
DS.Tables(0).Rows(1).Item("Name") = "VALUE TO REPLACE WITH"
DS.WriteXml("c:\inetpub\wwwroot\xmlTest\xmlemp.xml")
End Sub
Now how can I have it search that Dataset for a particular string, and then change the value of that string? For example:
In my xml, i will have keywords such as %@Prospects% and %@Name% that I want to replace with values, but now can I tell the vb to search for those values instead of me having to know where they are beforehand?
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|