vrijdag 11 november 2016

C# > Modifying xml files

I have been neglecting my blog for way too long again. The short term and adhoc is once again getting in the way of the long term learning. Often test data comes in the way of XML files, and often that data needs to be modified to suit your needs or stay up to date. Recently I have been given the task of enriching existing test XMLs with an extra node. To do this manually would be possible but error-prone and mind-numbingly boring. Let's investigate how we can enrich the test XMLs with this new node automatically.

Scenario 1: we have an .xsd of the test XML which we have converted into C# classes giving us the ability to deserialize the XMLs into C# objects and modify them accordingly.

And... It was actually so easy and trivial to enrich the document via this method it ended the blog post right there.


Geen opmerkingen:

Een reactie posten