Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Parse xmldocument attributes(not elements) and display in treeview, then save treeview into xmldocument

Parse xmldocument attributes(not elements) and display in treeview, then save treeview into xmldocument

Scheduled Pinned Locked Moved Visual Basic
csharpquestiondatabasesql-server
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tanya foster
    wrote on last edited by
    #1

    ------------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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups