ABSTRACT

This chapter deals with XML, short for eXtensible Markup Language. XML is technically a completely language-independent topic. Scala was developed with XML in mind and makes it easy to work with.

In chapter 9, we learned how to read “from” and “write to” text files. The files that we used in that and the following chapters are what are called “flat” text files. They have the data in them with nothing that tells us about the nature of the data other than formatting. The advantages of this are that it is fairly simple to read and write and it can be both read and written with standard tools like a text editor. The disadvantages are that it can be slow and it lacks any inherent meaning so it is hard to move the information from one program to another. It is also somewhat error prone because so much information is in the formatting. XML addresses the latter disadvantage, without losing the advantages.