A More Complex DTD

<!ELEMENT SONG (TITLE, PHOTO?, COMPOSER+, PRODUCER*, 
              LYRICS_AVAILABLE?, SHEET_MUSIC_AVAILABLE?,
              PUBLISHER*, LENGTH?, YEAR?, ARTIST+, 
              PHOTO?, DESCRIPTION)>

<!ATTLIST SONG CATEGORY (DISCO | POP | ROCK) #REQUIRED
               ALBUM CDATA #IMPLIED>
<!ATTLIST ARTIST URL CDATA #IMPLIED>
<!ATTLIST PUBLISHER URL CDATA #IMPLIED>

<!ELEMENT LYRICS_AVAILABLE EMPTY>
<!ELEMENT PHOTO EMPTY>
<!ELEMENT SHEET_MUSIC_AVAILABLE EMPTY>

<!ATTLIST PHOTO SRC    CDATA #REQUIRED
                ALT    CDATA #REQUIRED
                WIDTH  CDATA #REQUIRED
                HEIGHT CDATA #REQUIRED
>

<!ELEMENT ARTIST    (#PCDATA)>
<!ELEMENT METAPHOR  (#PCDATA)>
<!ELEMENT IRONIC    (#PCDATA)>
<!ELEMENT PERSON    (#PCDATA)>
<!ELEMENT TITLE     (#PCDATA)>
<!ELEMENT COMPOSER  (#PCDATA)>
<!ELEMENT PRODUCER  (#PCDATA)>
<!ELEMENT PUBLISHER (#PCDATA)>
<!ATTLIST PUBLISHER xlink:type CDATA #IMPLIED
                    xlink:href CDATA #IMPLIED
>

<!ELEMENT LENGTH (#PCDATA)>
<!-- This should be a four digit year like "1999",
     not a two-digit year like "99" -->
<!ELEMENT YEAR (#PCDATA)>

<!ELEMENT OPINION (#PCDATA | METAPHOR)*>
<!ELEMENT DESCRIPTION (#PCDATA | PERSON | IRONIC | OPINION 
                               | METAPHOR | ARTIST | TITLE)*>

Previous | Next | Top | Cafe con Leche

Copyright 2002-2006 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified January 2, 2006