Working with XML in .NET
This course will teach you to create, load, save, and query XML files using the classes within the System.Xml.Linq namespace in .NET.
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 will learn foundational knowledge to process XML files and use XML to enhance your business applications. First, you will learn to process XML documents using LINQ to XML. Next, you will discover how to write XPath queries. Then, 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 will 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#.
Table of contents
- The System.Xml.Linq Namespace 1m
- Create Empty XML Document 2m
- Create XML with Elements and Attributes 3m
- Create a Nested XML Document 2m
- Parse XML String in XDocument Object 2m
- Parse XML String in XElement Object 2m
- Adding an Element in an XML Document 2m
- Updating an Element in an XML Document 3m
- Deleting an Element in an XML Document 2m
- Loading XML Documents 1m
- Load XML Using XDocument and XElement 2m
- Displaying the First Node 3m
- Writing XML to Disk 2m
- Using the XmlWriter Class to Save XML to Disk 3m
- Using a DataSet to Write XML to Disk 3m
- Write XML to Disk from Any Table in Any Database 2m
- Validating XML 2m
- Validating XML and Viewing the Errors 2m
- Overview of XPath and Why XPath Still Matters 2m
- Differences Using XPath with XDocument and XElement 3m
- When You Get Errors Using XPath 1m
- Resolving Errors by Using an Extension Method 3m
- Filtering Data Using XPath Queries 2m
- Using XPath Functions Such as last() and position() 2m
- Creating C# Objects from XML 2m
- Retrieve Attribute XML 2m
- Retrieving Attribute-Based XML Using Extension Method 3m
- XPath Functions count(), sum(), and Calculating an Average 4m
- Calculating Minimum and Maximum Values 3m
- LINQ to XML Overview 2m
- Using XDocument and Xelement with LINQ to XML 2m
- Applying a Where Clause to an XML Document 2m
- Retrieving a Single Node 1m
- Sorting XML Nodes using OrderBy Clause 1m
- Creating a Collection of C# Objects 1m
- Joining Two XML Documents 3m
- Working with Nested XML Documents 2m
- Using Attribute-Based XML 2m
- Searching and Sorting Attribute-Based XML 1m
- Using LINQ Methods Count and Sum 2m
- Using the LINQ Average Method 1m
- Calculating Minimum and Maximum 2m
- Why Use XML Serialization? 2m
- Serialize a Product Object to XML Using XmlSerializer 2m
- Deserialize XML from File Into a Product Object 1m
- Formatting XML Using the XmlWriterSettings Object 3m
- Deserialize Formatted XML Into a Product Object 2m
- Simplify XML Serialization Using an Extension Method 3m
- Using XML Serialization Attributes 4m
- Serializing a Composite Class to Create Nested XML 2m
- Using the DataContractSerializer Class 3m
- Using the BinaryFormatter Class 4m
- Caching XML From SQL Server 1m
- The Code to Read Data From SQL and Store into Local File 2m
- Step-Through of Getting Data from SQL and Serializing 1m
- A Method to Detect Changes on the Server 2m
- Get Max Date and Total Rows from XML and Server 2m
- Checking Local vs Server Information 2m
- Change the Server and Detect the Changes 4m