TOC

This article is currently in the process of being translated into Swedish (~45% done).

XML:

Introduction to XML with C#

XML är en förkortning för Extensible Markup Language. Det är ett vida använt format för att utbyta data, mest för att det är lätt att läsa för båda människor och datorer. Om du någonsin har gjort en hemsida i HTML, kommer XML kännas mycket bekant, eftersom det är i stort sätt en striktare variant av HTML. XML är uppbyggt av taggar, attribut och ser ut ungefär så här:

<users>
<user name="John Doe" age="42" />
<user name="Jane Doe" age="39" />
</users>

As you can see, for a data format, this is actually pretty easy to read, and because it's such a widespread standard, almost every programming language has built-in functions or classes to deal with it. C# is definitely one of them, with an entire namespace, the System.Xml namespace, to deal with pretty much any aspect of XML. In the following chapters, we will look into using them, both for writing and reading XML. Read on!


This article has been fully translated into the following languages: Is your preferred language not on the list? Click here to help us translate this article into your language!