Working with XML in C#
Learn to use LINQ to XML and XPath queries to process XML files in C#. Use XML serialization to store .NET objects in an XML file and deserialize XML back into a .NET object. Learn to cache frequently used data in a local XML file.
What you'll learn
What are the best methods for reading and writing XML documents in C#? In this course, Working with XML in C#, you learn foundational knowledge to process XML files and use XML to enhance your business applications. First, you learn to process XML documents using LINQ to XML. Next, you discover how to write XPath queries. Next, you see how to add, edit and delete data within an XML document. XML serialization is explored to show you how to save a .NET object to an XML file, and then restore that XML as a .NET object. Finally, you explore how to cache frequently used database data as a local XML file, and to detect when server data changes so you can update your local file. When you’re finished with this course, you will have the skills and knowledge of XML needed to process XML documents in C#. Software required: Visual Studio 2017/19, .NET 4.5, .NET 5, SQL Server, C#.
Table of contents
- Version Check 0m
- Course Introduction and Assumptions 1m
- Modules in This Course 2m
- Examples and Uses of XML Files 2m
- Terminology Used to Describe XML Documents 1m
- Tag Naming and Attribute-based XML 2m
- A Simple XML Schema File 4m
- A More Complex XML Schema 2m
- Generate an XSD File from an XML File 1m
- Validate an XML from an XSD File 1m
- Module Summary 1m
- LINQ to XML Introduction 1m
- Load XML Using XDocument and XElement 3m
- Query All Nodes in XML Document 2m
- Use a Where Clause to Filter XML Data 3m
- Use an OrderBy Clause to Sort XML Data 1m
- Joining Two XML Documents 2m
- Read Configuration File 2m
- Create Collection Classes from XML Document 3m
- Count and Sum Values 2m
- Maximum and Minimum Values 1m
- Calculate an Average Value 1m
- Module Summary 1m
- Module Introduction 1m
- Create New XML Document 2m
- Use the Parse Method to Load a String of XML 1m
- Add a Node 1m
- Update a Node 1m
- Delete a Node 1m
- Write XML to Disk Using the XDocument Class 2m
- Using the XmlWriter Class to Save XML to Disk 3m
- Using the DataSet Class to Save XML and XSD to Disk 2m
- Module Summary 1m
- Module Introduction 1m
- Using the XmlSerializer Class 5m
- Controlling Serialization with Attributes 4m
- Nested Objects and the XmlArray Attribute 2m
- Simplify Serialization with XML Extension Methods 3m
- Opt-In Serialization with the DataContractSerializer Class 5m
- Using the BinaryFormatter Class 4m
- Module Summary 1m