0

i have an xml file, i have some values like good, and bad, with Tag Quality. I want to read the xml file and print the ones which are Bad, in the Excel sheet which is existing. Can anyone help me Please. My XML file looks same as Below. So in that text i want to write entire HYDR. instrument id, HYDR.Quality" Only for Bad Values in HYDR.Quality Element.

<HYDR.Instrument id="ABR"> <HYDR.Quality>Good</HYDR.Quality> <HYDR.Value>0</HYDR.Value> </HYDR.Instrument> <HYDR.Instrument id="ABR_DUMMY"> <HYDR.Quality>Bad</HYDR.Quality> <HYDR.Value>0</HYDR.Value> </HYDR.Instrument> <HYDR.Instrument id="ABR_LOOP_JP"> <HYDR.Quality>Good</HYDR.Quality> <HYDR.Value>15.208 kg/cm2g</HYDR.Value> </HYDR.Instrument> <HYDR.Instrument id="ABR_MOV_12"> <HYDR.Quality>Good</HYDR.Quality> <HYDR.Value>0</HYDR.Value> </HYDR.Instrument>

1 Answers1

0

Basically you need to use two libraries to get to the answer you want:

  1. First you need to load the XML file, so I suggest using the Linq library, you can start from here

  2. Then, you need to write the filtered XML elements to excel, I suggest to use the aspose library, you can start learning from here

Using these two libraries, you can achieve what you want.

Community
  • 1
  • 1
Ehsan
  • 4,334
  • 7
  • 39
  • 59