Chapter 19XML and JSON

Wrox.com Code Downloads for this Chapter

You can find the wrox.com code downloads for this chapter at www.wrox.com/go/beginningvisualc#2015programming on the Download Code tab. The code is in the Chapter 19 download and individually named according to the names throughout the chapter.

Just as programming languages like C# describe computer logic in a format that is readable by both machines and humans, XML and JSON are both data languages, which are used storing data in a simple text format that can be read by both humans and nearly any computer.

Most C# .NET applications use XML in some form for storing data, such as .config files for storing configuration details and XAML files used in WPF and Windows Store applications. Because of this important fact, we'll spend the most time in this chapter on XML, with just a short look at JSON on the side.

During this chapter you will learn the basics of XML and JSON and then learn how to create XML documents and schemas. You will learn the basics of the XmlDocument class, how to read and write XML, how to insert and delete nodes, how to convert XML to JSON format, and finally how to search for data in XML documents using XPath.

XML Basics

Extensible Markup Language (XML) is a data language, which is a way of storing data in a simple text format that ...

Get Beginning C# 6.0 Programming with Visual Studio 2015 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.