<!-- ================================================================== -->
<!--              WDUL recipe markup language (wdulrecipe) DTD          -->
<!--  Date: 12/31/2006                                                  -->
<!--                                                                    -->
<!--  Copyright (c) 2006, 2007 Leon C. Glover III, LJ Wine Products Inc -->
<!--  PUBLIC  "-//WDUL//DTD WDULrecipe 0.1//EN"                         -->
<!--  SYSTEM  "http://www.WDUL.COM/recipes/wdul-recipe.dtd              -->
<!--                                                                    -->
<!--  http://www.wdul.com                                               -->   
<!-- =================================================================  -->

<!-- ================================================ -->
<!--                attribute entities                -->
<!-- ================================================ -->

<!-- attributes common to nearly all elements -->
<!ENTITY % core.att '
  id		ID	#IMPLIED
  class		NMTOKEN	#IMPLIED
  title		CDATA	#IMPLIED'>

<!-- attributes for elements that contain measurements -->
<!ENTITY % measurement.att '
  system	(US | Imperial | metric | SI | other)	#IMPLIED'>

<!-- attributes for elements that are division        -->
<!ENTITY % div.att '
  %core.att;
  %measurement.att;
  type	(main | variation | titled) "titled"'>

<!-- ================================================ -->
<!--                     class entities               -->
<!-- ================================================ -->

<!ENTITY % inline.class 'span | frac | sep'>
<!ENTITY % measure.class 'amt | time | temp'>
<!ENTITY % step.class 'brandname | ingref | steptime | %inline.class; | %measure.class;'>

<!-- ================================================ -->
<!--                content model entities            -->
<!-- ================================================ -->

<!ENTITY % amt.cont '(amt, (sep?, amt)*)'>
<!ENTITY % time.cont '(time, (sep?, time)*)'>
<!ENTITY % templ.cont '(temp, (sep?, temp)*)'>
<!ENTITY % ing.cont '((%amt.cont;)?, modifier?, item, prep?, ing-note*, 
  prodcode*)'>
<!-- ================================================ -->
<!--                document element                  -->
<!-- ================================================ -->

<!ELEMENT wdulrecipe (meta*, (recipe))>
<!ATTLIST wdulrecipe
  version NMTOKEN #FIXED "0.1"
  generator CDATA #IMPLIED
  %core.att;>

<!-- data which describes the whole document -->
<!-- the meta attributes match those of the HTML 4.0 meta element -->
<!ELEMENT meta EMPTY>
<!ATTLIST meta
  name (DC.Title | DC.Subject | DC.Description | DC.Type |
	DC.Source | DC.Relation | DC.Coverage |
	DC.Creator | DC.Publisher | DC.Contributor | DC.Rights |
	DC.Date | DC.Format | DC.Identifier | DC.Language)
  #REQUIRED
  content CDATA #REQUIRED
  scheme  CDATA #IMPLIED
  lang	  CDATA #IMPLIED >

<!ELEMENT recipe (head, description*, ingredients, directions)>
<!ATTLIST recipe
  %core.att;
  %measurement.att; >

<!-- =============================================== -->
<!--             head and its children               -->
<!-- =============================================== -->

<!ELEMENT head (title, version?, infosource?, preptime?, yield?)>

<!ELEMENT title (#PCDATA | brandname | %inline.class;)*>
<!ATTLIST title
  %core.att; >

<!ELEMENT version (#PCDATA)>
<!ATTLIST version
  %core.att;>

<!ELEMENT infosource ( magazine | book | website )*>
<!ATTLIST infosource
  %core.att;
  type (magazine | book | website) "magazine">

<!ELEMENT magazine ((title, name, author, volume?, issue?, pageref) |
 (title, name, author, volume?, issue?, pageref?, isbn?))>
<!ATTLIST magazine
  %core.att;>

<!ELEMENT volume (#PCDATA)>

<!ELEMENT issue (#PCDATA)>

<!ELEMENT book ((title, author, pageref?) | (title, author, isbn?, pageref?))*>
<!ATTLIST book
  %core.att;>

<!ELEMENT name (#PCDATA)>

<!ELEMENT firstname (#PCDATA)>

<!ELEMENT lastname (#PCDATA)>

<!ELEMENT author (firstname, lastname)>
<!ATTLIST author
  %core.att;>

<!ELEMENT isbn (#PCDATA)>
<!ATTLIST isbn
  %core.att;>

<!ELEMENT website (title, url)>
<!ATTLIST website
  %core.att;>

<!ELEMENT url (#PCDATA)>
<!ATTLIST url
  %core.att;>

<!ELEMENT pageref (#PCDATA)>
<!ATTLIST pageref
  %core.att;>

<!ELEMENT preptime (%time.cont;)>
<!ATTLIST preptime
  %core.att;
  type CDATA #REQUIRED>
  <!-- type: example value: preparation, rising, marinating, cooking, etc -->

<!ELEMENT yield (#PCDATA | quantity | range | unit)*>
<!ATTLIST yield
  %core.att;>

<!ELEMENT ingredients (ingredient-div+ | ingredient )>
<!ATTLIST ingredients
  %core.att;
  %measurement.att; >

<!ELEMENT ingredient-div (title?, description?, note*, ingredient, (note | ingredient)*)>
<!ATTLIST ingredient-div
  %div.att; >

<!ELEMENT ingredient (%ing.cont;)>
<!ATTLIST ingredient
  %core.att;
  optional (yes | no) "no" >

<!ELEMENT modifier (#PCDATA | size | %measure.class; | %inline.class;)*>
<!ATTLIST modifier
  %core.att; >

<!ELEMENT item (#PCDATA | brandname | %inline.class;)*>
<!ATTLIST item
  %core.att;>

<!ELEMENT prep (#PCDATA | size | %measure.class; | %inline.class;)*>
<!ATTLIST prep
  %core.att;>

<!ELEMENT ing-note (#PCDATA | %measure.class; | %inline.class;)*>
<!ATTLIST ing-note
  %core.att; >

<!-- ==================================================================== -->
<!--               Directions and sub-elements                            -->
<!-- ==================================================================== -->

<!ELEMENT directions (direction-div+ | ((note | ingredient)*, step, (note | ingredient | step)*))>
<!ATTLIST directions
  %core.att;
  %measurement.att;>

<!ELEMENT direction-div (title?, description?, (note | ingredient)*, step, (note | ingredient | step)*)>
<!ATTLIST direction-div
  %div.att;
  duration CDATA #IMPLIED >

<!ELEMENT step (#PCDATA | %step.class; | substep)*>
<!ATTLIST step
  %core.att;
  duration CDATA #IMPLIED
  type CDATA "cooking"
  optional (yes | no) "no" >

<!ELEMENT substep (#PCDATA | %measure.class; | %inline.class;)*>
<!ATTLIST substep
  %core.att;
  duration CDATA #IMPLIED
  type CDATA "cooking"
  optional (yes | no) "no" >

<!ELEMENT ingref (#PCDATA | brandname | quantity | range | size | unit | 
  %inline.class;)*>
<!ATTLIST ingref
  %core.att; 
  ingid IDREF #REQUIRED >

<!ELEMENT steptime (%time.cont;)>

<!-- ================================================================== -->
<!--                measurements and utility elements                   -->
<!-- ================================================================== -->
<!-- explanatory block of text that may precede a recipe or section -->
<!ELEMENT description (#PCDATA | %measure.class; | %inline.class;)*>
<!ATTLIST description
  %core.att;>

<!-- informative block of text thatt may be within a section -->
<!ELEMENT note (#PCDATA | %measure.class; | %inline.class;)*>
<!ATTLIST note
  %core.att;
  type CDATA #IMPLIED >
  <!-- type: typical values would be - Note, Tip, Hint, Suggestion -->

<!ELEMENT amt (quantity?, size?, unit?)>
<!ATTLIST amt
  %core.att;
  %measurement.att;
  variation CDATA #IMPLIED >

<!ELEMENT quantity (#PCDATA | frac)*>
<!ATTLIST quantity
  %core.att;>

<!ELEMENT size (#PCDATA | quantity | unit)*>
<!ATTLIST size
  %core.att;
  code NMTOKEN #IMPLIED >

<!ELEMENT unit (#PCDATA)>
<!ATTLIST unit
  %core.att;
  %measurement.att;
  unit NMTOKEN #IMPLIED
  type (mass | weight | volume | area | length | other ) #IMPLIED >

<!ELEMENT time (quantity, timeunit)>
<!ATTLIST time
  %core.att;>

<!ELEMENT timeunit (#PCDATA)>
<!ATTLIST timeunit
  %core.att;
  %measurement.att;
  unit NMTOKEN #IMPLIED >

<!ELEMENT temp (quantity, tempunit)>
<!ATTLIST temp
  %core.att;
  %measurement.att;
  unit (C | F | K) #IMPLIED >

<!-- fraction -->
<!ELEMENT frac (n, sep?, d)>
<!ATTLIST frac
  %core.att; >
<!ELEMENT n (#PCDATA)>
<!ELEMENT d (#PCDATA)>
<!-- n, d CONSTRAINT: content must be restricted to decimal digits -->
<!-- separator - punctuation or word(s) appearing between elements -->
<!-- e.g.: 2 <sep>to</sep> 3 pounds -->
<!-- content is optionaly displayed depending on style sheet -->

<!ELEMENT sep (#PCDATA)>
<!ATTLIST sep
  %core.att;>

<!ELEMENT brandname (#PCDATA | mfr | product)*>
<!ATTLIST brandname
  %core.att;>

<!ELEMENT mfr (#PCDATA | %inline.class;)*>
<!ATTLIST mfr
  %core.att;
  uccMin NMTOKEN #IMPLIED >
  <!-- uccMin: Uniform Code Council Manufactuerer Identification Number -->
  <!-- (see http://www.uc-council.org) -->

<!ELEMENT product (#PCDATA | %inline.class;)*>
<!ATTLIST product
  %core.att;
  uccIcn NMTOKEN #IMPLIED >
  <!-- uccIcn: Uniform Code Council Item Code Number -->
  <!-- (see http:///www.uc-council.org) -->

<!ELEMENT span (#PCDATA | %inline.class;)*>
<!ATTLIST spac
  %core.att;>

<!-- ============================================================= -->
<!--                        END of WDUL-recipe DTD                 -->
<!-- ============================================================= -->
