The score.mod file defines the basic structure of a MusicXML file. The primary definition of the file is contained in these lines:
<![ %partwise; [ <!ELEMENT score-partwise (%score-header;, part+)> <!ELEMENT part (measure+)> <!ELEMENT measure (%music-data;)> ]]> <![ %timewise; [ <!ELEMENT score-timewise (%score-header;, measure+)> <!ELEMENT measure (part+)> <!ELEMENT part (%music-data;)> ]]>
The %partwise; and %timewise; entities are set in the top-level DTDs partwise.dtd and timewise.dtd. The <![ lines indicate a conditional clause like the #ifdef statement in C. So if partwise.dtd is used, the <score-partwise> element is defined, while if timewise.dtd is used, the <score-timewise> element is defined. You can see that the only difference between the two formats is the way that the part and measure elements are arranged. A score-partwise document contains one or more part elements, and each part element contains one or more measure elements. The score-timewise document reverses this ordering. In either case, the lower-level elements are filled with a music-data entity. This contains the actual music in the score, and is defined as:
<!ENTITY % music-data "(note | backup | forward | direction | attributes | harmony | figured-bass | print | sound | barline | grouping | link | bookmark)*">
In addition, each MusicXML file contains a %score-header; entity, defined as:
<!ENTITY % score-header "(work?, movement-number?, movement-title?, identification?, defaults?, credit*, part-list)">
We will now look at the score-header entity in more detail. If the example in the preceding “Hello World” section gave you enough information, you may want to skip ahead to the next section that starts describing music-data.