-2

I am a beginner in C# and XML. I want to know how I can parse through XML files and combine many files into one file based on the nodes. All the XML files have the same format and the same kind of nodes.

3

1 Answer 1

0

It can be a bit advanced for you, but taking into account that all your XML files are structurally identical (and valid XML files) you can use xsd.exe tool to create class from one of the XML files and then use deserializer to load them one-by-bone from the file as class. Then you can use whatever you want and aggregate them the way you like. See the following link for instructions: https://stackoverflow.com/a/364410/1786034

When everything is in memory aggregated you can just use Linq-to-XML to generated the final file or serealize the object you've build in memory back to a single XML file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.