The format is specified by the following grammar in DTD:
<!ELEMENT test ( title, prologue?, item+, epilogue? ) > <!ELEMENT title ( #PCDATA ) > <!ELEMENT item ( question, answer+ ) > <!ELEMENT question ( #PCDATA ) > <!ELEMENT answer ( #PCDATA ) > <!ATTLIST answer correct ( true | false ) "false" > <!ELEMENT prologue ( #PCDATA ) > <!ELEMENT epilogue ( #PCDATA ) >To allow for whitespace markup, any HTML between an end tag and a begin tag is ignored in the ultimate output.
See how the annotated test source file displays as HTML.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>Sample Test</title>
</head>
<body>
<h1>Sample Test</h1>
Below is a sample test:
<p>
{test}
{item}
{question}
What is the <em>minimum</em> speed limit?
{/question}<p>
{answer correct="true"}
45
{/answer}<p>
{answer}
55
{/answer}<p>
{answer}
65
{/answer}<p>
{answer}
70
{/answer}<p>
{/item}<p>
{item}
{question}
What <a href="http://www.worldtime.org">time</a>
is noon?
{/question}<p>
{answer}
10:00
{/answer}<p>
{answer}
11:00
{/answer}<p>
{answer correct="true"}
12:00
{/answer}<p>
{answer}
1:00
{/answer}<p>
{/item}<p>
{item}
{question}
What has four sides?
{/question}<p>
{answer}
Triangle <img alt="Triangle"
src="http://peb.cs.cmu.edu/icons/TRIANGLE.GIF">
{/answer}<p>
{answer correct="true"}
Square <img alt="Square"
src="http://peb.cs.cmu.edu/icons/SQUARE.GIF">
{/answer}<p>
{answer}
Circle <img alt="Circle"
src="http://peb.cs.cmu.edu/icons/CIRCLE.GIF">
{/answer}<p>
{/item}<p>
{/test}<p>
That was the test.
</body>
</html>