<?xml version="1.0" encoding="UTF-8"?>

<!-- Root element can be tale, story, or poem -->
<!ELEMENT tale (title, number, encyclopedia?, (p | lg)+)>
<!ELEMENT poem (title, author, filename, encyclopedia?, lg+)>
<!ELEMENT story (title, author, filename, encyclopedia?, intro?, (p | lg)+) >

<!-- Title and intro may include information that needs to be extracted -->
<!ELEMENT title (#PCDATA | ling | note | quote)*>
<!ELEMENT number (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT filename (#PCDATA) >
<!ELEMENT encyclopedia (encycEntry)+ >
<!ELEMENT encycEntry (#PCDATA) >
<!ATTLIST encycEntry
     link CDATA #IMPLIED>
<!ELEMENT intro (#PCDATA | citation | quote | note | url | ling)* >

<!-- Annotations can be linguistic or [cultural] commentary -->
<!-- Notes may have punctuation that must be chopped -->
<!ELEMENT note (noteText, noteExplanation)>
<!ELEMENT noteText (#PCDATA | ling| line | quote)*>
<!ATTLIST noteText chop CDATA #IMPLIED>
<!ELEMENT noteExplanation (#PCDATA | gloss | quote | morphology | citation | articleTitle | url | xref)*>

<!ELEMENT ling (lingText, lingExplanation)>
<!ELEMENT lingExplanation (#PCDATA | gloss | quote | morphology | emphasis | url | citation)*>
<!ELEMENT lingText (#PCDATA)>

<!-- Chunks are line groups (with lines) and paragraphs -->
<!ELEMENT p (#PCDATA | note | ling)*>
<!ELEMENT lg (line | note)+ >
<!ELEMENT line (#PCDATA | note | ling)*>

<!-- Inline elements -->
<!ELEMENT citation (#PCDATA | ling )*>
<!ELEMENT bookTitle (#PCDATA | note | ling )*>
<!ELEMENT morphology (#PCDATA)>
<!ELEMENT gloss (#PCDATA)>
<!ELEMENT quote (#PCDATA)>
<!ELEMENT emphasis (#PCDATA)>
<!ELEMENT articleTitle (#PCDATA)>
<!ELEMENT url (#PCDATA)>

<!-- Cross-references to tales can be embedded in commentary -->
<!ELEMENT xref (title, number)>
