Parse xmldocument attributes(not elements) and display in treeview, then save treeview into xmldocument
-
------------Begin Update on my original question I have been able to successfully store the attribute list in the TreeNode.Tag field in the AddNode function. I have changed the line of code in AddNode function inTreeNode.Text = inTreeNode.Text & " " & (attrNode.OuterXml).Trim TO inTreeNode.Tag = inTreeNode.Tag & " " & (attrNode.OuterXml).Trim I do not see the Tag field displayed on the treeview though. Then I changed the line of code in SaveScreenChangesToFile function Else StreamWriterForXml.Write("<" & currentTreeNode.Text & ">") TO Else StreamWriterForXml.Write("<" & currentTreeNode.Text & " " & currentTreeNode.Tag & ">") -- now I can save the attributes to an output. But part of my original questions remains... how to display attributes in treeview? Do I HAVE TO populate the TreeNode.text field with attributes to see it? Which will have the effect of complicating my function when I go to write it out as a file. I will have to parse the TreeNode.text field more carefully. -----------End Update on my original question Hello, I am having success with the following code in parsing element's attributes and displaying them in a treeview in visual studio 2003 in a vb.net application. However, when I go to save the treeview using the following code, I do not get any attributes. I am wondering if the way I am storing the attributes in the treeview is the problem. It seems you can display attributes in a treeview but they are still considered elements in a treeview structure. Below is the code I am using. By the way, when I only display elements in the treeview using the code below, there is no problem displaying or saving elements. It is only when I try to add the ability to display and save attributes that my trouble begins because I miss creating ending tags in the saved output and it just gets totally wierd for other things. I am sorry I am not explaining all the output problems when I try to deal with attributes. If anyone is able to shed some light, I will be glad to bore you with the details. thanks. tanya BEGIN code that parses xmldocument into treeview ----- begin button subroutine that fires off reading xml from ------sql server and dumping it into a datatable, then read ------ datatable into an xmldocument Private Sub ButtonUseThisQuotNumber_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonUseThisQuotNumber.Click PopulateDataSetWithXml(ComboBoxHelper.Text) ButtonUseThisQuotNumber.Visible = F