Creating a new MEI Document

To start working with MEI, first download the current schema. A RelaxNG version is available at http://github.com/music-encoding/music-encoding/blob/develop/schemata/mei-CMN.rng. Download this file and save it in a folder of your choice. In that same folder, create a new XML file in Oxygen or another schema-aware XML editor. A minimal MEI file must contain the following (please copy & paste to avoid errors):

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="mei-cmn.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<mei xmlns="http://www.music-encoding.org/ns/mei">
    <meiHead>
        <fileDesc>
            <titleStmt>
                <title/>
            </titleStmt>
            <pubStmt/>
        </fileDesc>
    </meiHead>
    <music>
       <!-- music content goes in here -->
    </music>
 </mei>

If you put the RNG file in a different folder than your new MEI file, you will have to adjust the relative path to that folder in the schema references above. All of the following examples assume that you will start a new MEI file in the same manner. The use of a schema-aware XML editor such as Oxygen is highly recommended, although any text editor is capable of writing correct XML.