Jo S

Jo S

  • NA
  • 4
  • 622

Loading dynamic XML files in to a tree view control

Apr 5 2018 8:48 PM
I am a newbie in programming and I'm trying to display metadata of some files using C#.Net.It is a web application intended to be hosted on our office intranet. I have been using Visual Studio 2017 with .NET framework version 4.6.1.
 
I have created several xml files for meta data and placed a TreeView web server control in my design page.Can you please tell me a way to populate the TreeView control from the xml files. A sample xml code is given below.
  1. <?xml version="1.0" encoding="utf-8"?>    
  2. <metadata>    
  3. <idinfo>    
  4. <citation>    
  5. <citeinfo>    
  6. <origin>Jay Diffendorfer</origin>    
  7. <origin>Roger Compton</origin>    
  8. <origin>Louisa Kramer</origin>    
  9. <origin>Zach Ancona</origin>    
  10. <origin>Donna Norton</origin>    
  11. <pubdate>201402</pubdate>    
  12. <title>Onshore Industrial Wind Turbine Locations for the United States through July 2013</title>    
  13. <geoform>Maps and Data - vector digital data</geoform>    
  14. <pubinfo>    
  15. <pubplace>Denver, CO</pubplace>    
  16. <publish>United States Geological Survey (USGS)</publish>    
  17. </pubinfo>    
  18. <onlink>http://dx.doi.org/10.3133/ds817 andhttp://eerscmap.er.usgs.gov/windfarm/</onlink>    
  19. </citeinfo>    
  20. </citation>    
  21. </idinfo>    
  22. </metadata>  
The above xml should be displayed as a tree strcture as :
 
Identification Information:
         Citation:
                  Citation Information:
                           Originator: Jay Diffendorfer
                           Originator: Roger Compton
                           Originator: Louisa Kramer
                           Originator: Zach Ancona
                           Originator: Donna Norton
                           Published Date: 2014 02
                           Title: Onshore Industrial Wind Turbine Locations for the United States through July 2013
                           Geoform:Maps and Data - vector digital data
                           Publication Information:
                                    Published Place: Denver, CO
                                    Published by: United States Geological Survey (USGS)
                                    Online Link:http://dx.doi.org/10.3133/ds817 andhttp://eerscmap.er.usgs.gov/windfarm/

Answers (1)