<!-- CELLAR.DTD
     Meta-DTD of the CELLAR architecture for mapping
     SGML data into CELLAR's object model of data
     Gary Simons, Summer Institute of Linguistics
     URL: http://www.sil.org/cellar/import/cellar.dtd

 Version 2, 25 Oct 1997
     Added textBefore, textAfter, textBetween
     Added MISSING to conditional expression language

 Version 1, 4 Oct 1997
     Version published in SGML/XML '97 conference paper
                                                              -->

<!ENTITY % content "object | attr | ignore | double | #PCDATA"  >

<!--                                                          --
  -- OBJECT: the element corresponds to an object in CELLAR   --
  --                                                          -->
<!ELEMENT object - -  (%content;)*                              >
<!ATTLIST object
     class       -- Create this class of CELLAR object        --
                 CDATA #REQUIRED
     parentAttr  -- Put the object in this attr of its parent --
                 CDATA #IMPLIED  
     contentAttr -- Put embedded objects in this attribute    --
                 CDATA #IMPLIED
     pcdataClass -- Create this class for embedded PCDATA     --
                 CDATA "String"
     textBetween -- Put this text between embedded PCDATA     --
                 CDATA #IMPLIED  
     encoding    -- Put embedded strings in this encoding     --
                 CDATA #IMPLIED  
     id          -- A unique identifier for this object       --
                 ID    #IMPLIED
     attrName    -- Set this attribute of the object ...      --
                 CDATA #IMPLIED
     attrValue   -- ... to this value                         --
                 CDATA #IMPLIED
     attrType    -- The value is an IDREF or of named class   --
                 CDATA "String"
     attrName2   -- Set another attribute of the object ...   --
                 CDATA #IMPLIED
     attrValue2  -- ... to this value                         --
                 CDATA #IMPLIED
     attrType2   -- The value is an IDREF or of named class   --
                 CDATA "String"                                 >

<!--                                                          --
  -- ATTR: the element corresponds to an attribute in CELLAR  --
  --                                                          -->
<!ELEMENT attr - -    (%content;)*                              >
<!ATTLIST attr
     contentAttr -- Put embedded objects in this attribute    --
                 CDATA #IMPLIED
     pcdataClass -- Create this class for embedded PCDATA     --
                 CDATA "String"
     textBetween -- Put this text between embedded PCDATA     --
                 CDATA #IMPLIED  
     encoding    -- Put embedded strings in this encoding     --
                 CDATA #IMPLIED                                 >

<!--                                                          --
  -- IGNORE: the element corresponds to nothing in CELLAR;    --
  --         ignore it at this level, but process its content --
  --                                                          -->
<!ELEMENT ignore  - - (%content;)*                              >
<!ATTLIST ignore
     encoding    -- Put embedded strings in this encoding     --
                 CDATA #IMPLIED
     textBefore  -- Prepend this text to embedded PCDATA      --
                 CDATA #IMPLIED
     textAfter   -- Append this text to embedded PCDATA       --
                 CDATA #IMPLIED
     textBetween -- Put this text between embedded PCDATA     --
                 CDATA #IMPLIED                                 >

<!--                                                          --
  -- DOUBLE: the element corresponds to two CELLAR objects;   --
  --         the second object is embedded in the first       --
  --                                                          -->
<!ELEMENT double - -  (%content;)*                              >
<!ATTLIST double
     class       -- Create this class for first CELLAR object --
                 CDATA #REQUIRED
     parentAttr  -- Put first object in this attr of parent   --
                 CDATA #IMPLIED  
     contentAttr -- Put 2nd object in this attr of 1st object --
                 CDATA #IMPLIED
     pcdataClass -- Create this class for embedded PCDATA     --
                 CDATA "String" 
     textBetween -- Put this text between embedded PCDATA     --
                 CDATA #IMPLIED 
     encoding    -- Put embedded strings in this encoding     --
                 CDATA #IMPLIED  
     id          -- A unique identifier for first object      --
                 ID    #IMPLIED
     attrName    -- Set this attribute of first object ...    --
                 CDATA #IMPLIED
     attrValue   -- ... to this value                         --
                 CDATA #IMPLIED
     attrType    -- The value is an IDREF or of named class   --
                 CDATA "String"
     class2      -- Create this class for 2nd CELLAR object   --
                 CDATA #REQUIRED
     contentAttr2 -- Put embedded objects in this attribute   --
                  -- of the second object                     --
                 CDATA #IMPLIED
     attrName2   -- Set this attribute of the 2nd object ...  --
                 CDATA #IMPLIED
     attrValue2  -- ... to this value                         --
                 CDATA #IMPLIED
     attrType2   -- The value is an IDREF or of named class   --
                 CDATA "String"                                 >

<!--                                                          --
  -- Note on additional semantics supported by the parser     --
  -- that reads CELLAR architectural documents and creates    --
  -- the corresponding structure of objects:                  --

  -- DISCARD:                                                 --
  -- If the value of parentAttr, contentAttr, or              --
  -- contentAttr2 is "DISCARD", all embedded content is       --
  -- thrown away.                                             --

  -- CONDITIONAL EXPRESSIONS:                                 --
  -- All architectural attributes with a declared value of    --
  -- CDATA (excepting attrValue and attrValue2) may take a    --
  -- conditional expression of the following form:            --
  --                                                          --
  --    expression ::=  guarded-case* otherwise-case          --
  --    guarded-case ::= "if" parent-class  target-value      --
  --    otherwise-case  ::=  target-value                     --
  --    target-value ::= quoted-string | cellar-name |        --
  --                     "MISSING"                            --
  --                                                          --
  --    The special target-value "MISSING" causes the         --
  --    expression to return nothing at all.                  --
  --                                                          --
  -- For instance,  "if Figure caption heading" means:        --
  --    If the class of the parent object is "Figure",        --
  --    then return "caption"; otherwise, return "heading".   --
  --                                                          -->



