adding new nodes to xml file

Results 1 to 2 of 2

Thread: adding new nodes to xml file

  1. #1
    Join Date
    Dec 1969

    Default adding new nodes to xml file

    hi,<BR><BR>I&#039;m trying to add new nodes to a xml file but nothing is happening. I am not getting any error messages either. I&#039;m not quite sure what is wrong with my code:<BR><BR>Public Sub WriteToChat(ByVal UserID As Integer, ByVal Username As String)<BR> Dim xl As New XmlDocument<BR> Dim tr As New XmlTextReader("C:InetpubwwwrootLosanetChatChatText .xml")<BR> xl.Load(tr)<BR> Dim xeUser As XmlElement = xl.CreateElement("cUser")<BR> xl.DocumentElement.AppendChild(xeUser)<BR> Dim xeName As XmlElement = xl.CreateElement("cName")<BR> xeName.AppendChild(xl.CreateTextNode("" & Username & ""))<BR> xeUser.AppendChild(xeName)<BR> Dim xeText As XmlElement = xl.CreateElement("cText")<BR> xeText.AppendChild(xl.CreateTextNode("has entered the room"))<BR> xeUser.AppendChild(xeText)<BR> End Sub<BR><BR>thanks for any suggestions,<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Well

    I know it sounds stupid but it could be that you&#039;re not calling the subfunction.<BR><BR>Have you tried stepping through the code?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts