I have several XML files that I need to work with, and I always used XElement objects and pulled data through the attribute name or XElement value.
I know there must be a better way to use XML in C #. What is the best way to either generate or manually create a strong typed object from an XML file?
xml is in the form
<Group id="####"> <title>Some Title</title> <description>some description</description> <Rule id="ID_##" severity="medium" weight="10.0"> <version>1.001</version> <title>Another Title</title> <description>Very long description</description> <fixtext fixref="F-31r1_fix">Description of fix</fixtext> <fix id="F-31r1_fix"/> <check system="C-7883r4_chk"> <check-content-ref name="M" href="URI"/> <check-content>Content</check-content> </check> </Rule> </Group>
If I could parse the XML file into a List<Group> , which would be the best.
The only way I can do this is to manually create the Group, Rule, and Check objects and manually assign the data. If there is a better, more automatic way to do this, please let me know!
c # xml
joe_coolish
source share