Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
.NET Essentials: LINQ for XML

.NET Essentials: LINQ for XML

1h 33mIntermediate2021-04-16

Authors

Walt Ritscher

Walt Ritscher

Programmer, UI Designer, Staff Instructor at LinkedIn Learning

Course details

The first explanation you typically hear about Microsoft LINQ is that it provides an in-language query tool to manipulate the contents of arrays and lists. Explore LINQ further and you’ll find it works with other popular data sources like XML files. In this course, instructor Walt Ritscher shows you how LINQ to XML uses LINQ extension methods to read, create, search, and manipulate XML in a simplified way. Walt walks you through LINQPad, the lightweight, powerful code editor and code runner that is used in this course, then explains how to load XML into different LINQ classes. He covers how you can get different elements and attributes from XML and some of the ways you can work with elements and attributes, after getting them. Walt describes a variety of query operators that you can use. He concludes with a discussion on how you can create and edit XML structure with LINQ.

Skills covered

.NETSoftware Development ToolsMicrosoftSoftware DevelopmentOne-Off

Concepts

0. Introduction

  • 01 - Query and transform your XML data with LINQ
  • 02 - What you should know
  • 03 - How to access the sample code on GitHub
  • 04 - Why this course uses LINQPad
  • 05 - Install LINQPad

1. Load XML into LINQ Classes

  • 06 - Understand LINQ for XML
  • 07 - The XML data files for this course
  • 08 - Load data from an XML file
  • 09 - Quick look at the XElement class
  • 10 - Parse XML in an XML string
  • 11 - Save the XML document

2. Work with Elements and Attributes

  • 12 - Get an element from XML
  • 13 - Get an attribute from XML
  • 14 - Get nodes when using schema namespace
  • 15 - Get single or multiple elements
  • 16 - Get child element
  • 17 - Get child elements
  • 18 - Use Descendants() to recurse child elements
  • 19 - Get attributes
  • 20 - Read element and attribute values
  • 21 - Change element and attribute values
  • 22 - Use SetElementValue to add, remove, and modify child elements
  • 23 - Use SetValue to set with non-string data

3. Query Operators

  • 24 - Use Query syntax to work with elements
  • 25 - Attribute query
  • 26 - Select data into a new anonymous type
  • 27 - Where clause on attribute value
  • 28 - Where clause with compare
  • 29 - Aggregate queries
  • 30 - Choose output order with OrderBy
  • 31 - Query for empty elements and blank values
  • 32 - Group by
  • 33 - Challenge - Create custom string output
  • 34 - Solution - Create custom string output
  • 35 - Challenge - Filter results to show elements with no content
  • 36 - Solution - Filter results to show elements with no content
  • 37 - Challenge - Filter results to show invalid values
  • 38 - Solution - Filter results to show invalid values

4. Create and Edit XML Structure

  • 39 - Use the DumpFormatted extension method
  • 40 - XDocument compared to XElement
  • 41 - Create XML structure
  • 42 - Rename elements and attributes
  • 43 - Replace elements and attributes
  • 44 - Remove element
  • 45 - Add parent element and move elements
  • 46 - Challenge - Move attributes and elements
  • 47 - Solution - Move attributes and elements

Conclusion

  • 48 - Next steps

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
Zarinpal
Zibal