Please help me in writing the code for extracting the data values from the XML file using C++ code.
The xml file is as follows
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="utf-8"?>
- <Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <!-- Configuration Type -->
- <CfgType>
- <Name>Ane Justin</Name>
- <MachineModels>
- <MachineModel>
- <ModelNo>2345678</ModelNo>
- <MonitorTypes>
- <MonitorType>
- <MonitorName>17" LCD</MonitorName>
- <ScreenResolution>
- <Resolution>1024*768</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- <ScreenResolution>
- <Resolution>800*600</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- </MonitorType>
- <MonitorType>
- <MonitorName>19" LCD</MonitorName>
- <ScreenResolution>
- <Resolution>1024*768</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- <ScreenResolution>
- <Resolution>800*600</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- </MonitorType>
- </MonitorTypes>
- </MachineModel>
- <MachineModel>
- <ModelNo>0789456</ModelNo>
- <MonitorTypes>
- <MonitorType>
- <MonitorName>17" CRT</MonitorName>
- <ScreenResolution>
- <Resolution>1024*768</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- <ScreenResolution>
- <Resolution>800*600</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- </MonitorType>
- <MonitorType>
- <MonitorName>19" CRT</MonitorName>
- <ScreenResolution>
- <Resolution>1024*768</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- <ScreenResolution>
- <Resolution>800*600</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- </MonitorType>
- </MonitorTypes>
- </MachineModel>
- </MachineModels>
- </CfgType>
- <CfgType>
- <Name>Jessica Sis</Name>
- <MachineModels>
- <MachineModel>
- <ModelNo>456789</ModelNo>
- <MonitorTypes>
- <MonitorType>
- <MonitorName>17" LCD</MonitorName>
- <ScreenResolution>
- <Resolution>1024*768</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- <ScreenResolution>
- <Resolution>800*600</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- </MonitorType>
- <MonitorType>
- <MonitorName>19" LCD</MonitorName>
- <ScreenResolution>
- <Resolution>1024*768</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- <ScreenResolution>
- <Resolution>800*600</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- </MonitorType>
- </MonitorTypes>
- </MachineModel>
- <MachineModel>
- <ModelNo>345678</ModelNo>
- <MonitorTypes>
- <MonitorType>
- <MonitorName>17" CRT</MonitorName>
- <ScreenResolution>
- <Resolution>1024*768</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- <ScreenResolution>
- <Resolution>800*600</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- </MonitorType>
- <MonitorType>
- <MonitorName>19" CRT</MonitorName>
- <ScreenResolution>
- <Resolution>1024*768</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- <ScreenResolution>
- <Resolution>800*600</Resolution>
- <RefreshRate>60</RefreshRate>
- </ScreenResolution>
- </MonitorType>
- </MonitorTypes>
- </MachineModel>
- </MachineModels>
- </CfgType>
- </Settings>
Now, the output should be shown as follows on the console window:
Expand|Select|Wrap|Line Numbers
- Ane Justin
- 2345678
- 17" LCD
- 1024*768
- 60
- 800*600
- 60
- 19" LCD
- 1024*768
- 60
- 800*600
- 60
- 0789456
- 17" LCD
- 1024*768
- 60
- 800*600
- 60
- 19" LCD
- 1024*768
- 60
- 800*600
- 60
- Jessica Sis
- 456789
- 17" LCD
- 1024*768
- 60
- 800*600
- 60
- 19" LCD
- 1024*768
- 60
- 800*600
- 60
- 345678
- 17" LCD
- 1024*768
- 60
- 800*600
- 60
- 19" LCD
- 1024*768
- 60
- 800*600
- 60
Many Thanks...