Lösungen zum Aufgabenblatt 1, Aufgabe 1.

Aufgabe 1.1

<!ELEMENT bib  (book* )>
<!ELEMENT book  (title,  (author+ | editor+ ), publisher, price )>
<!ATTLIST book  year CDATA  #REQUIRED >
<!ELEMENT author  (last, first )>
<!ELEMENT editor  (last, first, affiliation )>
<!ELEMENT title  (#PCDATA )>
<!ELEMENT last  (#PCDATA )>
<!ELEMENT first  (#PCDATA )>
<!ELEMENT affiliation  (#PCDATA )>
<!ELEMENT publisher  (#PCDATA )>
<!ELEMENT price  (#PCDATA )>

Aufgabe 1.2

<!ELEMENT reviews (entry*)>
<!ELEMENT entry   (title, price, review)>
<!ELEMENT title   (#PCDATA)>
<!ELEMENT price   (#PCDATA)>
<!ELEMENT review  (#PCDATA)>

Aufgabe 1.3

<!ELEMENT book (title, author+, section+)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT section (title, (p | figure | section)* )>
<!ATTLIST section
      id         ID    #IMPLIED
      difficulty CDATA #IMPLIED>
<!ELEMENT p (#PCDATA)>
<!ELEMENT figure (title, image)>
<!ATTLIST figure
       width   CDATA   #REQUIRED
       height  CDATA   #REQUIRED >
<!ELEMENT image EMPTY>
<!ATTLIST image
       source  CDATA   #REQUIRED >  

Aufgabe 1.4

<!ENTITY % text "(#PCDATA | emph)*">

<!ELEMENT report (title, chapter+)>
<!ELEMENT title %text;>
<!ELEMENT chapter (title, intro?, section*)>
<!ATTLIST chapter
               shorttitle CDATA #IMPLIED>
<!ELEMENT intro (para | graphic)+>
<!ELEMENT section (title, intro?, topic*)>
<!ATTLIST section
               shorttitle CDATA #IMPLIED
               sectid ID #IMPLIED>
<!ELEMENT topic (title, (para | graphic)+)>
<!ATTLIST topic
               shorttitle CDATA #IMPLIED
               topicid ID #IMPLIED>
<!ELEMENT para (#PCDATA | emph | xref)*>
<!ATTLIST para
               security (u | c | s | ts) "u">
<!ELEMENT emph %text;>
<!ELEMENT graphic EMPTY>
<!ATTLIST graphic
               graphname ENTITY #REQUIRED>
<!ELEMENT xref EMPTY>
<!ATTLIST xref
               xrefid IDREF #IMPLIED>

Aufgabe 1.5

<!DOCTYPE partlist [
    <!ELEMENT partlist (part*)>
    <!ELEMENT part EMPTY>
    <!ATTLIST part
          partid  CDATA  #REQUIRED
          partof  CDATA  #IMPLIED
          name    CDATA  #REQUIRED>
]>