Hi,
I cannot figure out why there is an "ArgumentNullException" error for the following code. I get the error on the line that adds the first child's value to the listbox. The listbox is there.
This is the XML file I'm trying to read:
Any help please?
__________________
code is enduring
I cannot figure out why there is an "ArgumentNullException" error for the following code. I get the error on the line that adds the first child's value to the listbox. The listbox is there.
Code:
Dim objXMLDocument As New XmlDocument
Dim objXMLRootElement As XmlElement
Dim objXMLRecensieElement As XmlElement
objXMLDocument.Load("\Program Files\XML Try for PPC\Recensies.xml")
objXMLRootElement = objXMLDocument.DocumentElement
For Each objXMLRecensieElement In objXMLRootElement
ListBox1.Items.Add(objXMLRecensieElement.FirstChild.Value)
Next
This is the XML file I'm trying to read:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<recensies>
<recensie>
<groep>Toneelschuur</groep>
<stuk>De dag en de nacht en de dag na de dood</stuk>
<locatie>LAK theater</locatie>
<datum>10-10-2005</datum>
<cijfer>9+</cijfer>
<notitie>Boeiend verhaal, goede tekst, warm en inspannend gespeeld.</notitie>
</recensie>
<recensie>
<groep>Riek Swarte</groep>
<stuk>De Groote Storm</stuk>
<locatie>LAK theater</locatie>
<datum>09-10-2005</datum>
<cijfer>7</cijfer>
<notitie>vooral leuk voor de spelers.</notitie>
</recensie>
</recensies>
Any help please?
__________________
code is enduring