Tutorial by Examples

The goal is to generate the following XML document: <FruitBasket xmlns="http://www.fruitauthority.fake"> <Fruit ID="F0001"> <FruitName>Banana</FruitName> <FruitColor>Yellow</FruitColor> </Fruit> <Fruit ID="F000...
To modify an XML file with XDocument, you load the file into a variable of type XDocument, modify it in memory, then save it, overwriting the original file. A common mistake is to modify the XML in memory and expect the file on disk to change. Given an XML file: <?xml version="1.0" e...
Goal: <FruitBasket xmlns="http://www.fruitauthority.fake"> <Fruit> <FruitName>Banana</FruitName> <FruitColor>Yellow</FruitColor> </Fruit> <Fruit> <FruitName>Apple</FruitName> <FruitColor>Red<...

Page 1 of 1