Tag Archives: XDocument

C# Convert XML to JSON using dynamic ExpandoObject, XDocument and NewtonSoft.JSON

So I receive these XML feeds from my client, but I need to enrich the contents before I can use the data. AND I would like to work with JSON instead. So how to do that with a few lines … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , , , , , | Leave a comment

C# Working with Namespaces in XDocument and XML

XDocument is your old XML friend in C#, and it allows you to create or manipulate XML documents. To work with namespaces, you must use the XNamespace class. This is an imaginary XML document (a Google Merchant Feed formatted one) … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , | 1 Comment

Remove duplicates from XML feed

Apparently XML isn’t dead yet, and today I received a Google Product Feed in the RSS 2.0 XML format. The feed was full of duplicates and my job is to remove them: As you can see, “Product 100” appears twice. … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , | 1 Comment