T
trevor.niemack
I have just done an application that will allow you to insert XML into
a text box then do an xpath query to return the values against the
node. I am just a beginner so for me this is really cool but I want to
be able to get the nodes that returned information to be highlighted.
This is an example of my code at current:
Imports System.Xml
Public Class Form1
Dim used As Boolean
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim xmlstring As String = TextBox1.Text
'"<root><item>Trevor</item><item>Niemack</item><item>27 years
old</item><item>Married</item><item>Employed</item></root>"
Dim doc As New XmlDocument
doc.LoadXml(xmlstring)
Dim node As XmlNode
If used = True Then
used = False
End If
For Each node In doc.SelectNodes(TextBox3.Text)
ListBox1.Items.Add(node.InnerText)
used = True
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
ListBox1.Items.Clear()
used = False
End Sub
End Class
a text box then do an xpath query to return the values against the
node. I am just a beginner so for me this is really cool but I want to
be able to get the nodes that returned information to be highlighted.
This is an example of my code at current:
Imports System.Xml
Public Class Form1
Dim used As Boolean
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim xmlstring As String = TextBox1.Text
'"<root><item>Trevor</item><item>Niemack</item><item>27 years
old</item><item>Married</item><item>Employed</item></root>"
Dim doc As New XmlDocument
doc.LoadXml(xmlstring)
Dim node As XmlNode
If used = True Then
used = False
End If
For Each node In doc.SelectNodes(TextBox3.Text)
ListBox1.Items.Add(node.InnerText)
used = True
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
ListBox1.Items.Clear()
used = False
End Sub
End Class