MML DTD

Last updated: May 2002

Here is a draft of the MML DTD in HTML format. This version may be changed without notice.

Some attributes still need fine-tuning.

<!-- Music Markup Language DTD version 1.0 -->
<!-- MML = Music Markup Language -->
<!-- Draft Feb 2001
Author: Jacques Steyn
email: jacques@musicmarkup.info
web: http://www.musicmarkup.info/
Copyright 2001 Jacques Steyn
-->

<!-- ==================================== -->

<!-- =========== Entities =========== -->
<!ENTITY % organize "(album? | playlist?)" >
<!ENTITY % effect "(time, frequency, filters)" >
<!ENTITY % texture "(volume? | (envelope, harmonics)+)" >
<!ENTITY % synth "(primitives? | core? | preeffect? | soundset? | posteffect? | texture? | textureeffect? | instrument? | instrumenteffect? | band? | bandeffect? )" >
<!ENTITY % performance "CDATA" >
<!ENTITY % control "CDATA" >
<!ENTITY % MIDI "CDATA" >
<!ENTITY % play "(%texture; %synth; %effect; %performance; %control; %MIDI;)" >
<!ENTITY % bind "(bindbegin*, bindend*)">
<!ENTITY % slur "(slurbegin*, slurend*)">
<!ENTITY % notation "((%bind;)? | (%slur;)?)">
<!ENTITY % LinkTypes "CDATA">
<!ENTITY % URI "CDATA">

<!-- =========== basic entity =========== -->
<!ENTITY % basis
"tempo CDATA #IMPLIED
clef CDATA #IMPLIED
noteset CDATA #IMPLIED
note CDATA #IMPLIED
match CDATA #IMPLIED
">


<!-- =========== Root element: mml =========== -->
<!ELEMENT mml (%organize; | (head, song)+ | play?)>

<!-- =========== Head element =========== -->
<!ELEMENT head (title, meta?, link?, classes?, band?, sync?)>

<!ELEMENT title (#PCDATA)>

<!-- =========== Meta element =========== -->
<!ELEMENT meta EMPTY >
<!ATTLIST meta
http-equiv CDATA #IMPLIED
content CDATA #REQUIRED
charset CDATA #REQUIRED
description CDATA #REQUIRED
composer CDATA #REQUIRED
lang CDATA #REQUIRED
>

<!-- =========== Link element =========== -->
<!ELEMENT link EMPTY >
<!ATTLIST link
rel %LinkTypes; #REQUIRED
href %URI; #REQUIRED
type CDATA #REQUIRED
>


<!ELEMENT classes (#PCDATA)>
<!ELEMENT band (#PCDATA)>
<!ELEMENT sync (#PCDATA)>
<!ATTLIST sync
match CDATA #REQUIRED
with CDATA #REQUIRED
>


<!-- =========== Song element =========== -->
<!ELEMENT song (instrument? | div? | division? | repeat? | upbeat? | notation? | bar+ | text? | %synth; )>
<!ATTLIST song
key CDATA #REQUIRED
note CDATA #REQUIRED
>

<!-- =========== Instrument element =========== -->
<!ELEMENT instrument (#PCDATA)>
<!ATTLIST instrument
id ID #IMPLIED
type CDATA #REQUIRED
noteset CDATA #REQUIRED
>

<!-- =========== Div element =========== -->
<!ELEMENT div (#PCDATA)>
<!ATTLIST div
%basis;
key CDATA #REQUIRED

>

<!-- =========== Upbeat element =========== -->
<!ELEMENT upbeat (#PCDATA)>
<!ATTLIST upbeat
%basis;

>

<!-- =========== Bar element =========== -->
<!ELEMENT bar (beat? | %synth; )>
<!ATTLIST bar
%basis; >


<!-- =========== Beat element =========== -->
<!ELEMENT beat (#PCDATA)>
<!ATTLIST beat

>


<!-- =========== Repeat element =========== -->
<!ELEMENT repeat EMPTY>
<!ATTLIST repeat
idno CDATA #REQUIRED
>

<!-- =========== Text element =========== -->
<!ELEMENT text (#PCDATA)>
<!ATTLIST text

style CDATA #IMPLIED
>
<!-- lang NAME #IMPLIED RFC1766 language code -->


<!-- =========== Notation element =========== -->

<!ELEMENT bindbegin EMPTY>
<!ATTLIST bindbegin
id ID #IMPLIED
beat CDATA #REQUIRED
note CDATA #REQUIRED
clef CDATA #REQUIRED
>

<!ELEMENT bindend EMPTY>
<!ATTLIST bindend
end CDATA #REQUIRED
beat CDATA #REQUIRED
note CDATA #REQUIRED
>

<!ELEMENT slurbegin EMPTY>
<!ATTLIST slurbegin
id ID #IMPLIED
beat CDATA #REQUIRED
note CDATA #REQUIRED
>

<!ELEMENT slurend EMPTY>
<!ATTLIST slurend
end CDATA #REQUIRED
beat CDATA #REQUIRED
note CDATA #REQUIRED
>

1999, 2000, 2001 Author: Jacques Steyn