How can I add an attribute to an existing XML element in VB.Net?
I open a file then I read the XML data from it:
Dim xmldoc As New XmlDataDocument()
Dim xmlnode As XmlNodeList
Dim source As String = $"C:\sample.xml"
Dim fs As New FileStream(source, FileMode.Open, FileAccess.Read)
xmldoc.Load(fs)
xmlnode = xmldoc.GetElementsByTagName("student")
How do I add an "id" attribute to each "student" element?