Hello
I have an assignment where I have a XML file with data and I need to able to read it inside something like a listbox where I'm able to select the name of a company and all the other data related to that company name is shown.
Example:
<?xml version="1.0"?>
-<clients>
-<client id="1">
<name>Acrobedding (Cloud)</name>
<sender>cloud@acrobedding.com</sender>
<errorWords>failed|error</errorWords>
<falseWords>Warnings: []|Errors: []|Failed to process path:|FilesWithError: 0|VerboseErrors:</falseWords>
<link>e-mail adress</link>
<days>MA|DI|WO|DO|VR</days>
</client>
So for example I have to able to select Acrobedding from a list and all the other data shows in a label or textbox (Sender, Errorwords, ...)
I have been able to read all the data in VB in a cmd but it's nothing like the end result it should be.
Here's what I have:
Imports System.Xml
Module Module1
Sub Main()
Dim reader As XmlTextReader = New XmlTextReader("input.xml")
Do While (reader.Read())
Select Case reader.NodeType
Case XmlNodeType.Element 'Display beginning of element.
Console.Write("<" + reader.Name)
If reader.HasAttributes Then 'If attributes exist
While reader.MoveToNextAttribute()
'Display attribute name and value.
Console.Write(" {0}='{1}'", reader.Name, reader.Value)
End While
End If
Console.WriteLine(">")
Case XmlNodeType.Text 'Display the text in each element.
Console.WriteLine(reader.Value)
Case XmlNodeType.EndElement 'Display end of element.
Console.Write("</" + reader.Name)
Console.WriteLine(">")
End Select
Loop
Console.ReadLine()
End Sub
If anyone knows a solution for my problem it would be much appreciated and if you need to know more then feel free to ask as I will check this post frequently while I search for more solutions.