×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Loading Dynamic XML Files In To A Tree View Web Server Control

Loading Dynamic XML Files In To A Tree View Web Server Control

Loading Dynamic XML Files In To A Tree View Web Server Control

(OP)
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.

CODE --> xml

<?xml version="1.0" encoding="utf-8"?>  
<metadata>  
<idinfo>  
<citation>  
<citeinfo>  
<origin>Jay Diffendorfer</origin>  
<origin>Roger Compton</origin>  
<origin>Louisa Kramer</origin>  
<origin>Zach Ancona</origin>  
<origin>Donna Norton</origin>  
<pubdate>201402</pubdate>  
<title>Onshore Industrial Wind Turbine Locations for the United States through July 2013</title>  
<geoform>Maps and Data - vector digital data</geoform>  
<pubinfo>  
<pubplace>Denver, CO</pubplace>  
<publish>United States Geological Survey (USGS)</publish>  
</pubinfo>  
<onlink>http://dx.doi.org/10.3133/ds817 andhttp://eerscmap.er.usgs.gov/windfarm/</onlink>  
</citeinfo>  
</citation>  
</idinfo>  
</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/

RE: Loading Dynamic XML Files In To A Tree View Web Server Control

Remember Google is your best friend as a programmer. Using a quick search I found this:
https://support.microsoft.com/en-us/help/317597/ho...

AND

https://stackoverflow.com/questions/245418/asp-net...


The examples may not be exactly what you need, but they should get you started. The key is to read the XML file into an XmlDocument object. Also, some of the code may be in VB.NET but it can be easily converted.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close