I am trying to list items from an xml file into an xml file. i am successfull to some extent but the items are not displayed in the list box what can be the problem.
here is the code and the xml file :
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myDataDoc As New XmlDataDocument
myDataDoc.Load(Server.MapPath("datastore/dictionary.xml"))
Dim wordlst As XmlNodeList
wordlst = myDataDoc.GetElementsByTagName("Words")
Dim x As XmlNode
For Each x In wordlst
wordlist.Items.Add(x.FirstChild().Value)
Next
wordlist.DataBind()
End Sub
XML FILE(dictionary.xml):
Code:
<?xml version="1.0" standalone="yes" ?>
<?xml-stylesheet href="dictionary.css" encoding="ISO-8859-6" type="text/css" ?>
<Dictionary>
<Words>
<Word>Fahim</Word>
<Word>GOES THE QUOTE</Word>
<Word>war</Word>
<Word>love</Word>
</Words>
</Dictionary>
payab