
If you want to know more about XML documents, how they work, and what they’re useful for, check out this introduction to XML course. In this example, our schema is simply called schema.xml, if you’d like to follow along. ĭon’t forget to name your XML schema with a. In this example, our Excel workbook is called student-data.xlsx, and so our root element tag is called. It should be renamed according to the name of your Excel spreadsheet.

You do not need to have the lines indented, but that aids readability.Īlso take note of the tags that hold the contents of each tag. Here’s an example XML schema for our Excel spreadsheet: Īs you can see, data elements have become and, in line with the columns in our data set. You only need to fill out a few examples manually, but we can get Excel to do the rest for us later. They do not have to be the exact name of the columns, as long as they’re in the correct order. You can change the name of the tags into the names of your columns. The “student-data” above includes a “record” element, which has three data elements, TAGNAME, TAGNAME2, and TAGNAME3. Because this is the first element, it is also called the “root element”. Everything in between these lines is part of this element. It is important that you have a closing tag for every opening tag, and that they are in the right order. The first line above opens the element, and the last line, which includes a “/”, ends this element. If you simplify this line and the last line, you have: The second line identifies that the data is about “student-data”. It identifies that it is an XML file, using the encoding UTF-8 and the XML version 1.0. You can create an XML schema in Notepad, as it is a text file format. An XML schema is the document that defines an XML file’s structure.

After you have your Excel document set up, you need an XML schema.
