matthew king

matthew king

  • NA
  • 52
  • 0

XML

May 18 2014 10:16 AM
Experts,
 
I am attempting to  read the xml file below, but have become frustrated over the last 24-hrs with my inability to understand xpath and/or linq.  Specifically, i'm attempting to abstract data based on user input.  For example, if the user inputs"0024" into the "txtCarID" textbox and fires the click event, txtCarModel textbox would be populated with Chevy Camaro and txtOrig textbox would be populated with United States.   Moreover, I need to populate the "cboxModel" combobox with all the Model ID associated with that particular car ID; so, if the user inputs "0024" into the "txtCarID" textbox, the "cboxModel" combobox would be populated with A01 and A03.  Any help you could provide would be greatly appreciated as I'm trying to learn xml.  Thank you!  
 
 
 
Student 
 
<?xml version="1.0"?>
<data>
<CAR id="0024">
<>Chevy Camaro</CarName>
<Country>United States</Country>
<State>Michigan</State>
<City>Detroit</City>
<model id="A01">
<doors>2</doors>
<eng>3.6</eng>
<mrsp>240000</mrsp>
</model>
<model id="A03">
<doors>2</doors>
<eng>5.7</eng>
<mrsp>31000</mrsp>
</model>
</CAR>
<CAR id="0028">
<>Chevy Cruz</CarName>
<Country>United States</Country>
<State>Michigan</State>
<City>Detroit</City>
<model id="A11">
<doors>4</doors>
<eng>1.8</eng>
<mrsp>19000</mrsp>
</model>
<model id="A13">
<doors>2</doors>
<eng>1.8T</eng>
<mrsp>21500</mrsp>
</model>
</CAR>
 

Answers (2)