Appendix

This appendix contains the fully formed DTD for our CyberCinema example, annotated with comments. As discussed in Chapter 5, this DTD splits our movie review documents up into a HEAD section and a BODY section. The HEAD section contains all the record-like data (such as the title, the date of publication, and the author information), and the BODY contains the actual text of the review. The text stylings (such as <I> for italics) have been borrowed from XHTML for simplicity. Such stylings are also convenient if you happen to be transforming to a delivery format of XHTML, or an XHTML variant, because you don't have to transform those tags that are already XTML tags.

Also note at the front of this DTD the use of XML entities to define content models (particularly %flow;) that are then used throughout the rest of the DTD—where other elements are defined. The %flow; entity definition itself is comprised of other entity definitions and %PCDATA (parseable character data).

<!DOCTYPE moviereview.1 SYSTEM "moviereview.dtd" [
<!—

This is the full DTD for movie reviews for the fictitious CyberCinema
movie review site.

Version 1.0

*** 22 August 2001
If all your changes are commented here, it will make the DTD
easier to understand when reading it for the first time.
*** 21 August 2001
A good idea is to have a version log at the top of your DTD in a
comment block like this one.

*** 20 August 2001
Tomorrow I will write another comment above.

—>

<!—
Pull in the regular entity definition for HTML, which includes
things like the British pound sign
—>

<!ENTITY % HTMLlat1 PUBLIC
   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
   "xhtml-lat1.ent">
%HTMLlat1;

<!ENTITY % HTMLsymbol PUBLIC
   "-//W3C//ENTITIES Symbols for XHTML//EN"
   "xhtml-symbol.ent">
%HTMLsymbol;

<!ENTITY % HTMLspecial PUBLIC
   "-//W3C//ENTITIES Special for XHTML//EN"
   "xhtml-special.ent">
%HTMLspecial;

<!—
Define entities for some of the content models we will be using in the
rest of the DTD.  That way, we can change these one place (up here)
and change the content models for many of the elements below
—>

<!ENTITY % fontstyle "I | B | U | SUB | SUP | BR">
<!ENTITY % special "MOVIE | REVIEW | PERSON">

<!ENTITY % list "UL | OL">

<!ENTITY % flow "(#PCDATA | %fontstyle; | %phrase; | %special;)*">

<!— The main root element for our reviews —>

<!ELEMENT CYBERCINEMA_REVIEW (HEAD, BODY)>

<!— Definition of the HEAD element and the contents thereof —>

<!ELEMENT HEAD (REVIEWED, HEADLINE, ABSTRACT, CREATE_DATE, LASTMOD_DATE, PUBLISH_DATE)>


<!— REVIWED TAG contains ID number of the movie being reviewed in this review —>

<!ELEMENT REVIEWED EMPTY>

<!ATTLIST REVIEWED
        ID                              NMTOKEN              #REQUIRED
>


<!— Author block where list of authors is found —>

<!ELEMENT AUTHOR_BLOCK (AUTHOR*)>

<!— Each individual author —>

<!ELEMENT AUTHOR (#CDATA)>

<!ATTLIST AUTHOR
        ID                              NMTOKEN              #REQUIRED
>
<!— The headline and abstract —>

<!ELEMENT HEADLINE (%flow;)*>

<!ELEMENT ABSTRACT (%flow;)*>


<!— The create date, last modified date and publish date of this
     review —>

<!ELEMENT CREATE_DATE #CDATA>

<!ATTLIST CREATE_DATE
                DATE                CDATA                #REQUIRED
>

<!ELEMENT LASTMOD_DATE #CDATA>

<!ATTLIST LASTMOD_DATE
                DATE                CDATA                #REQUIRED
>

<!ELEMENT PUBLISH_DATE #CDATA>

<!ATTLIST PUBLISH_DATE
                DATE                CDATA                #REQUIRED
>

<!— Definition of the BODY element and the contents thereof —>

<!ELEMENT BODY (%flow;)*>

<!— For centering text —>

<!ELEMENT CENTER (%flow;)*>
<!— Paragraph tag, for enclosing paragraphs —>

<!ELEMENT P (%flow;)*>

<!— Supersubscript and Subscript —>

<!ELEMENT (SUB|SUP) (%flow;)*>

<!— Empty tag to insert line breaks in text —>

<!ELEMENT BR EMPTY>

<!—
Lists we'll allow in this DTD.  Ordered lists and unordered
lists.  Again, this is pulled from HTML definition
—>

<!— Ordered lists (OL) Numbering style —>
<!ENTITY % OLStyle "CDATA"      — constrained to: "(1|a|A|i|I)" —>

<!ELEMENT OL - - (LI)+                 — ordered list —>
<!ATTLIST OL
  type        %OLStyle;      #IMPLIED  — numbering style —
  compact     (compact)      #IMPLIED  — reduced interitem spacing —
  start       NUMBER         #IMPLIED  — starting sequence number —
  >

<!— Unordered Lists (UL) bullet styles —>
<!ENTITY % ULStyle "(disc|square|circle)">

<!ELEMENT UL - - (LI)+                 — unordered list —>
<!ATTLIST UL
  type        %ULStyle;      #IMPLIED  — bullet style —
  compact     (compact)      #IMPLIED  — reduced interitem spacing —
  >

<!ELEMENT LI - O (%flow;)**             — list item —>
<!ATTLIST LI
  type        %LIStyle;      #IMPLIED  — list item style —
  value       NUMBER         #IMPLIED  — reset sequence number —
  >


<!— Our links for movies, people and other reviews —>

<!ELEMENT MOVIE (%flow;)*>

<!ATTLIST MOVIE
        xlink:type         (simple|extended|locator|arc)     #FIXED "locator"

     <!— This is a locator link because it points to an external resource —>

                xlink:href                NMTOKEN                #REQUIRED
                xlink:show                (new | embed | replace)   "replace"

     <!— When link is actuated (such as with a click) should the linked-to
          data come up in a new window, be embedded in the current window or
          replace the current content? —>

     xlink:actuate     (onRequest |onLoad)     "onRequest"
     <!— How should the link be activated? Default is on user request  —>
>

<!ELEMENT REVIEW (%flow;)*>

<!ATTLIST REVIEW
     xlink:type        (simple|extended|locator|arc)     #FIXED "locator"

     <!— This is a locator link because it points to an external resource —>

     xlink:href          NMTOKEN               #REQUIRED
     xlink:show          (new | embed | replace)     "replace"

     <!— When link is actuated (such as with a click) should the linked-to
          data come up in a new window, be embedded in the current window or
          replace the current content? —>

     xlink:actuate       (onRequest |onLoad)        "onRequest"
     <!— How should the link be activated? Default is on user request  —>
>

<!ELEMENT PERSON (%flow;)*>

<!ATTLIST PERSON
     xlink:type          (simple|extended|locator|arc)     #FIXED "locator"

     <!— This is a locator link because it points to an external resource —>

     xlink:href          NMTOKEN                    #REQUIRED
     xlink:show          (new | embed | replace)    "replace"

     <!— When link is actuated (such as with a click) should the linked-to
          data come up in a new window, be embedded in the current window or
          replace the current content? —>

     xlink:actuate       (onRequest |onLoad)        "onRequest"
     <!— How should the link be activated? Default is on user request  —>
>

]>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.121.160