matthew king

matthew king

  • NA
  • 52
  • 0

help with xml

Mar 7 2010 8:59 PM

Experts,

 I'm attempting to advance my understanding of XML.  I have dowloaded an xml document in the following format: 

 <?xml version="1.0" encoding="utf-8"?>
<videos>
    <video>
 <title>The Distinguished Gentleman</title>
 <director>Jonathan Lynn</director>
 <length>112 Minutes</length>
 <format>DVD</format>
 <rating>R</rating>
    </video>
    <video>
 <title>Her Alibi</title>
 <director>Bruce Beresford</director>
 <length>94 Minutes</length>
 <format>DVD</format>
 <rating>PG-13</rating>
    </video>
    <video>
 <title>The Day After Tomorrow</title>
 <director>Roland Emmerich</director>
 <length>124 Minutes</length>
 <format>DVD</format>
 <rating>PG-13</rating>
    </video>
    <video>
 <title>Other People's Money</title>
 <director>Alan Brunstein</director>
 <length>114 Minutes</length>
 <format>VHS</format>
 <rating>PG-13</rating>
    </video>
</videos>

I have a window from with a combobox and four textboxes.  When the form initiates it loads the titles (e.g. The Distinguished Gentleman, Her Alibi, and Other People's Money) into the combobox.  Now, I'm trying to read the other fields into designated textboxes based on the combobox input.  For example,  if the user selectes "The Day After Tomorrow" via the combobox, and clicks the button_1 method,  the textboxes would then be populated with the following:

Director.Text = Roland Emmerich

Length.Text=124 Minutes

Format .Text = DVD

Rating.Text= PG-13

 

I would appreciate any example code you could offer to help me figure this out.  I would also welcome any recommendations for a good XML tutorial book, as it relates to c#.


Answers (3)