Hi,
Yes it is possible but you would be better off using the System.Xml namespace and loading your XML file into a XmlDocument object and then work on it from there.
Something like this should work:
Import System.Xml
Put this into the form load event of an application:
Dim mdocNewXmlDoc2 As New XmlDocument
Dim oRootNode As XmlNode
Dim oNode As XmlNode
Try
mdocNewXmlDoc2.Load("C:\te
oRootNode = mdocNewXmlDoc2.DocumentEle
oNode = oRootNode.SelectSingleNode
If Not oNode Is Nothing Then
oRootNode.RemoveChild(oNod
End If
mdocNewXmlDoc2.Save("C:\te
Catch ex As SystemException
MessageBox.Show(ex.Message
End Try
Here is an example of the XMl file used. This is a very simple example
<Message>
<NodeToDelete1>Hello</Node
<NodeToDelete2>Hello</Node
<NodeToDelete3>Hello</Node
<NodeToDelete4>Hello</Node
<NodeToDelete5>Hello</Node
</Message>
Hope this helps,
Darren
Main Topics
Browse All Topics





by: sramesh2kPosted on 2007-03-29 at 23:23:28ID: 18821846
If that's not possible, any idea how to accomplish this using VB 2005?