Littlewood Posted November 23, 2012 Posted November 23, 2012 (edited) I am quite new to VB but am quite familiar with XML my xml is 60,000 lines long and is a family tree type of thing as the xml is a little large to find your way around i have a VB.NET program that loads each node to a textbox, from that how to i update and save the xml to its original file, i can send the attributes to individual text boxes if that is easier, i only need to change the Name and Tag, never the id as that is how i navigate the file. I am reading the xml with XmlDocument My xml code is below <Root Name="ted" id="100" Tag="teddy"> <Root1 Name="Sam" id="101" Tag="Sammy"> <Root2 Name="Mary" id="102" Tag="Mandy"> </Root2> </Root1> <Root1 Name="Jam" id="103" Tag="Jammy"> <Root2 Name="Piggy" id="104" Tag="Randy"> </Root2> </Root1> </Root> [/Code] Edited November 23, 2012 by Littlewood Quote
bokeh Posted November 25, 2012 Posted November 25, 2012 (edited) Re: View and Save XML in VB.NET Hi Littlewood, and welcome to a great forum! :) Have you looked at (maybe) possibly using a TreeView control? I found an old (but good) basic example, by forum member Machaira, of using an xml file with a Treeview control. It's attached to this post. The attachment had a few issues after going through the upgrade wizard (mostly faulty references in the vbproj file). So to get it to run without errors under VB.Net 2010 Express I ended up having to do a little project cleanup. I'll also attach the working upgraded project below. If you want to learn more about using VB.Net coding the TreeView control to work with XML files here's some links.. Microsoft kb article 308063: How To Populate a TreeView Control with XML Data in Visual Basic .NET CodeProject article: "Using Serialization to Persist TreeView Control (VB.NET)" off forum thread: "Read xml file to treeview, selection to listview, modify and save" my xml is 60' date='000 lines long and is a family tree type of thing[/size'] I think (if it were me) I would split up (parse) that file (either at design time or at runtime - depending on if it things change while the app is running). If is genealogy related may you could have some list/index/categories like: 1.) "Generations" ("First generations", "second generation", etc) or go time reversal (working your way backward in time): "First Generation back", "Second generation back", etc . 2.) A set of nodes/indices for Matriarchal and Patriarchal lineages 3.) A set of indices based on a multiple "bracketing" ranges for time born, or time died, etc Maybe breakdown / organize things by using a bunch (series/group) of interlinked (cascading) TreeView controls: a.) The first TreeView control contains the first set of "parent" nodes off the root b.) The second TreeView control contains the first set of "child" nodes for each parent. c.) etceteraTreeviewControl_Machaira_example.zip Edited November 26, 2012 by bokeh Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.