<!--
  upCast DTD

  Namespace = (null namespace)

  Copyright (c) 2001-2006 infinity-loop

  This DTD module is identified by the PUBLIC and SYSTEM identifiers:

%
  PUBLIC "-//infinity-loop//DTD upCast 5.0//EN"
  SYSTEM "http://www.infinity-loop.de/DTD/upcast/5.0/upcast.dtd"
%

  Version History:
  2004-09-01: initial version
  2006-02-14: Updated to account for new XHTML modularization xhtml-attribs-1.mod module
              by defining XHTML.global.attrs.prefixed and XHTML.xmlns.attrib.prefixed
              to be empty.
  2008-06-16: update references to XHTML modularization DTD modules after files have been
              removed from their previous locations at the W3C
              
              
@root document
@title upCast DTD
-->


<!--
    Entities for adding external elements to inline and block models
-->
<!-- Define this when you want to add custom elements that should be able to appear
     in inline content. Must end always in '|' when not empty! -->
<!ENTITY % inline.ext '' >

<!-- Define this when you want to add custom elements that should be able to appear
     in block content.  Must end always in '|' when not empty! -->
<!ENTITY % block.ext '' >

<!-- Define this when you want to add attributes to the common set of attributes. -->
<!ENTITY % commonatts.ext '' >

<!-- Define this to add external entities. -->
<!ENTITY % entities.ent '' >
%entities.ent;

<!-- 
    Useful Entities 
  -->
<!ENTITY % common.att 'xml:lang  NMTOKEN #IMPLIED
                       xml:base  CDATA   #IMPLIED
                       style     CDATA   #IMPLIED
                       id        ID      #IMPLIED
                       %commonatts.ext;
                       ' >

<!ENTITY % revision.att 'edit         (inserted | deleted | none) "none"
                         datetime     CDATA    #IMPLIED
                         authorname   CDATA    #IMPLIED
                         authorabbr   CDATA    #IMPLIED
                         '>

<!ENTITY % class.att  'class     CDATA #IMPLIED' >

<!-- 
    Element collections 
  -->
<!ENTITY % breakers   'linebreak | pagebreak | columnbreak | pagestart | linestart | literal | partbreak' >

<!ENTITY % forms      'formtext | formcheckbox | formdropdown' >

<!ENTITY % targets    'target | indextarget | endtarget' >

<!ENTITY % specials   'textbox | image | subdoc | annotation | footnote | endnote | gentext | toc | pagefooter | pageheader | object' >

<!ENTITY % inlines    '%inline.ext; inline | hidden | link | reference | highlight' >

<!ENTITY % blocks     '%block.ext; list | html:table | table | par | block' >

<!ENTITY % revtrack   'inserted | deleted'>

<!-- 
    Content models 
  -->
<!ENTITY % section.mdl    'section | %blocks; | %specials; | %targets; | %forms; | %breakers;' >

<!ENTITY % part.mdl       '%section.mdl;' >

<!ENTITY % par.mdl        '%inlines; | %breakers; | %forms; | %targets; | %specials; | %revtrack; ' >

<!ENTITY % subdoc.mdl     '%blocks; | %specials; | %targets; | %forms; | %breakers;' >
<!ENTITY % cell.mdl       '%subdoc.mdl;' >
<!ENTITY % item.mdl       '%subdoc.mdl;' >

<!ENTITY % inline.mdl     '%par.mdl;' >



<!--
The document element is the root element of an upCast DTD compliant document. It corresponds to the entire original RTF document.
-->
<!ELEMENT document (documentinfo?, style?, part*)>
<!-- 
@attr xmlns:xlink the fixed XLink namespace
@attr xmlns:html the fixed HTML4 namespace, used for HTML table elements
@attr xml:lang <p>the (natural) language this document's content is in</p>
<p>see also: <a href="http://www.oasis-open.org/cover/iso639a.html">ISO 639 Language Codes</a>, <a href="http://www.w3.org/TR/REC-xml/#sec-lang-tag">xml:lang</a></p>
-->
<!ATTLIST document xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink" 
                   xmlns:html  CDATA #FIXED "http://www.w3.org/HTML/1998/html4" 
                   %common.att; >





<!-- .............................................................................................
  Include the OASIS XML Exchange table model DTD.
  This is a subset of CALS.

-->
<!ENTITY % calstblx PUBLIC '-//OASIS//DTD XML Exchange Table Model 19990315//EN' 'soextblx.dtd'>
<!--
  Here, you decide if you want nested tables allowed in cell contents
  (compromising compatibility) or not by choosing the appropriate
  entry content model definition.
-->
<!-- <!ENTITY % pcd 'list | table | par | toc' > -->
<!ENTITY % pcd 'list | par | toc' >

<!-- 
  Add the 'style' attribute to table, row and entry elements.
-->
<!ENTITY % tbl.table.att  "pgwide      NMTOKEN       #IMPLIED
                           %common.att;"
>
<!ENTITY % tbl.row.att    "%common.att;">
<!ENTITY % tbl.entry.att  "%common.att;">

<!-- We do not support table titles -->
<!ENTITY % tbl.table-titles.mdl "">

%calstblx; <!-- import now after (re-) definition of entities done above -->





<!-- .............................................................................................
  Include the XHTML Tables Module.

-->

<!-- add the style attribute to each imported XHTML element -->
<!ENTITY % Core.extra.attrib
      "style CDATA #IMPLIED"
>
<!ENTITY % XHTML.xmlns.attrib "xmlns:html CDATA #FIXED 'http://www.w3.org/HTML/1998/html4'"> 
<!ENTITY % XHTML.bidi "IGNORE"> <!-- we do not support bidirectionality -->
<!ENTITY % xhtmldatatypes PUBLIC '-//W3C//ENTITIES XHTML Datatypes 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod'>
<!ENTITY % xhtmlattribs PUBLIC '-//W3C//ENTITIES XHTML Common Attributes 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-attribs-1.mod'>
<!ENTITY % XHTML.global.attrs.prefixed "IGNORE"> <!-- we do not want the global attributes modification -->
<!ENTITY % XHTML.xmlns.attrib.prefixed "" >
%xhtmldatatypes;  <!-- instantiate -->
%xhtmlattribs;    <!-- instantiate -->

<!ENTITY % htmltables PUBLIC '-//W3C//ELEMENTS XHTML Tables 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-table-1.mod'>
<!--
  We redefine the qualified names to have 'html' namespace prefix.
  So, we declare qualified element type names:
-->
<!ENTITY % table.qname  "html:table" >
<!ENTITY % caption.qname  "html:caption" >
<!ENTITY % thead.qname  "html:thead" >
<!ENTITY % tfoot.qname  "html:tfoot" >
<!ENTITY % tbody.qname  "html:tbody" >
<!ENTITY % colgroup.qname  "html:colgroup" >
<!ENTITY % col.qname  "html:col" >
<!ENTITY % tr.qname  "html:tr" >
<!ENTITY % th.qname  "html:th" >
<!ENTITY % td.qname  "html:td" >

<!ENTITY % td.content "(%cell.mdl;)*" ><!-- we use our own content model here -->
<!ENTITY % th.content "(%cell.mdl;)*" ><!-- we use our own content model here -->
<!ENTITY % caption.element  "IGNORE" > <!-- upCast does not support table captions -->
<!ENTITY % Flow.mix "" >               <!-- never actually used -->
%htmltables;                           <!-- import now after (re-) definition of entities 
                                            for fully qualified names -->


<!-- .............................................................................................
  upCast specific element definitions.

-->


<!-- This element groups meta-information of the original Word document. Its <code>property</code> child elements
     list one property each. These are both pre-defined Word/RTF meta properties like author's name, document creation date etc,
     as well as all custom defined document properties. -->
<!ELEMENT documentinfo      (property)*>

<!-- This element encapsulates one single document property. -->
<!ELEMENT property          EMPTY>
<!-- @attr name the name of the property

The following names are the pre-defined names for RTF source documents, available
through specialized dialogs in the Word UI:
<dl>
    <dt>title</dt>
        <dd>title of the document</dd>
    <dt>subject</dt>
        <dd>subject of the document</dd>
    <dt>author</dt>
        <dd>the document author's name</dd>
    <dt>manager</dt>
        <dd>manager of the author</dd>
    <dt>company</dt>
        <dd>company of the author</dd>
    <dt>operator</dt>
        <dd>person who last made changes to the document</dd>
    <dt>category</dt>
        <dd>the category name this document belongs to</dd>
    <dt>keywords</dt>
        <dd>a list of keywords for this document</dd>
    <dt>comment</dt>
        <dd>comments; this text is not shown anywhere in the Word UI</dd>
    <dt>doccomment</dt>
        <dd>comments displayed in the <em>Summary Info</em> or <em>Properties</em> dialog box in Word</dd>
    <dt>hlinkbase</dt>
        <dd>The base address that is used for the path of all relative hyperlinks inserted in the document. This can be a path or an Internet address (URL).</dd>
    <dt>creationTime</dt>
        <dd>creation time of the document</dd>
    <dt>revisionTime</dt>
        <dd>time when the document was last changed</dd>
    <dt>lastPrintTime</dt>
        <dd>time when the document was last printed</dd>
    <dt>lastBackupTime</dt>
        <dd>time when the last automatic backup of the document was created</dd>
    <dt>editingMinutes</dt>
        <dd>total editing time on the document in minutes</dd>
    <dt>numberOfPages</dt>
        <dd>total number of pages in the document when it was last saved in Word</dd>
    <dt>numberOfWords</dt>
        <dd>total number of words in the document when it was last saved in Word</dd>
    <dt>numberOfChars</dt>
        <dd>total number of text content characters when the document was last saved in Word (including whitespace characters)</dd>
    <dt>numberOfCharsWS</dt>
        <dd>total number of text content characters when the document was last saved in Word (<strong>not</strong> including whitespace characters)</dd>
    <dt>internalID</dt>
        <dd>this Word document's internal ID number</dd>
    <dt>creator</dt>
        <dd>the signature of the authoring application of this document (includes version info of downCast, e.g.)</dd>
</dl>

Any other name is available for use as a custom property name.

@attr value the value of the property
@attr type the type of the property

<dl>
    <dt>integer</dt>
        <dd>an integer number</dd>
    <dt>real</dt>
        <dd>a floating point number</dd>
    <dt>date</dt>
        <dd>an <a href="http://www.ietf.org/rfc/rfc822.txt">RFC 822, section 5</a> conforming date string</dd>
    <dt>boolean</dt>
        <dd>a string representing a boolean value and which is acceptable to the <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Boolean.html#Boolean(java.lang.String)"><code>java.lang.Boolean(String)</code> constructor</a> (see also for semantics)</dd>
    <dt>text</dt>
        <dd>text value</dd>
    <dt>docvar</dt>
        <dd>defines a document variable; only accessible via VB(A) scripts</dd>
    <dt>templateref</dt>
        <dd>the value is a path to a document template the source document relies upon. upCast generates a property name of <code>DocumentTemplateRef</code> for that variable.</dd>
</dl>

-->
<!ATTLIST property name  CDATA #IMPLIED
                   value CDATA #IMPLIED
                   type (integer | real | date | boolean | text | docvar | templateref | undefined) "text"
>

<!-- 
A <code>part</code> corresponds to a Word/RTF document's section. A document consists of at least one <code>part</code> which is required. 
-->
<!ELEMENT part (%part.mdl;)*>
<!ATTLIST part %common.att;
               %class.att;
>

<!-- 
A <code>section</code> is a (possibly nested up to 9 levels deep) structure created by upCast based on heuristics and heading styles used.
It corresponds to logical sections created implicitly by RTF's heading levels. Sections normally have a heading (because this is
what upCast uses to create them). Sections will not be created when you do not specify a document sectioner class or defeat upCast's  
default sectioner class. You may influence the creation of the section hierarchy by writing your own sectioner class implementation. 
-->
<!ELEMENT section (heading?, (%section.mdl;)*)>

<!-- 
@attr level this is a convenience attribute indicating the nesting level of this section
-->
<!ATTLIST section level (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9) "1"
                  %common.att;
                  %class.att;
>                  

<!-- 
A <code>heading</code> element contains the text marked up with Word's built-in heading styles or
styles that have an outline level set other than body text.
-->
<!ELEMENT heading (#PCDATA | %par.mdl;)*>

<!--
@attr level a convenience attribute indicating the nesting level of the section this <code>heading</code> is part of
-->
<!ATTLIST heading level (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9) "1"
                  %class.att;
                  %common.att;
>

<!-- 
a paragraph of text
-->
<!ELEMENT par (#PCDATA | %par.mdl;)*>
<!ATTLIST par %common.att;
              %class.att;
>

<!-- 
An <code>inline</code> element is a hook for attaching style information and changes found in text runs. They can be nested.
A <code>class</code> attribute's value specifies the name of the character format applied to the enclosed text run, and
the <code>style</code> attribute can be used to specify local, manual formatting overrides in CSS. Think of this element
as the equivalent to HTML's <code>span</code> element.
-->
<!ELEMENT inline (#PCDATA | %inline.mdl;)*>

<!ATTLIST inline %class.att;
                 %common.att;
>

<!-- 
This element marks up text runs that used Word's "highlight" function.
-->
<!ELEMENT highlight (#PCDATA | %inline.mdl;)*>

<!--
@attr color the color used for highlighting, as HTML hex color <code>#rrggbb</code>
-->
<!ATTLIST highlight color CDATA #IMPLIED
                    %common.att;
>

<!--
This element identifies portions of the document that are hidden on output ("hidden text").

Several upCast export filters let you decide whether you want this markup at all or the respective
text run should be dropped from the output in the first place.
-->
<!ELEMENT hidden (#PCDATA | %inline.mdl;)*>

<!-- 
This element groups list <code>item</code>s into a list. Styling determines the type (numbered/unnumbered). 
-->
<!ELEMENT list (item)*>

<!--
@attr startat for ordinal lists, sets the initial list item counter value. If not specified, this is implied to be "1".
@attr listtype the (numbering-) type of the list
-->
<!ATTLIST list startat NMTOKEN #IMPLIED
               listtype (disc | decimal | upper-roman | lower-roman | upper-alpha | lower-alpha) "disc"
               %common.att;
               %class.att;
>

<!--
a list item
-->
<!ELEMENT item (%item.mdl;)*>

<!--
@attr numberingtext the complete text content of this list item's marker. This may be useful for cases where the numbering
cannot currently be expressed using CSS alone.
-->
<!ATTLIST item numberingtext CDATA #IMPLIED
               %common.att;
>


<!-- 
an image or picture element
-->
<!ELEMENT image EMPTY>

<!--
@attr xlink:type the XLink link type; always <code>simple</code>
@attr xlink:href the link to the image file
@attr xlink:show the XLink show method; always <code>embed</code>
@attr xlink:actuate the XLink actuate behaviour; always <code>onLoad</code> since the image is loaded and displayed on document opening time
@attr width a number indicating the image with in pixels. The actual number depends on the output resolution (dpi) value specified in the export filter
@attr height a number indicating the image height in pixels. The actual number depends on the output resolution (dpi) value specified in the export filter
@attr description a textual description of the image content; similar to HTML's <code>alt</code> attribute
-->
<!ATTLIST image xlink:type NMTOKEN #FIXED "simple"
                xlink:href CDATA #IMPLIED
                xlink:show NMTOKEN #FIXED "embed"
                xlink:actuate NMTOKEN #FIXED "onLoad"
                width CDATA #IMPLIED
                height CDATA #IMPLIED
                description CDATA #IMPLIED
                %common.att;
>
<!--
A generalized element for a "subdocument" in a document, i.e. content that is taken out of the flow.

Normally, you should not see that element be ever written by upCast since specialized elements (<code>footnote</code>,
<code>annotation</code>,...) are available for all supported subdocument structures.
-->
<!ELEMENT subdoc (%subdoc.mdl;)*>

<!--
@attr type the internal type number constant of the subdocument
-->
<!ATTLIST subdoc type NMTOKEN #IMPLIED
                 %common.att;
>

<!-- 
This element marks up a (textual) reference to some other place in a document, like references
to pages or chapters: "<em>(see page 5)</em>". How that reference should be rendered to text form
can be specified using the <code>embed</code> attribute.
-->
<!ELEMENT reference (#PCDATA | %inline.mdl;)*>

<!--
@attr xlink:type the XLink link type; always <code>simple</code>
@attr xlink:href the link to the target location in the document; this mostly ever will be a document internal link to a fragment target (set by the <code>target</code> element)
@attr xlink:show the XLink show method; always <code>other</code>, since the actual representation is determined by the <code>embed</code> attribute
@attr xlink:actuate the XLink actuate behaviour; always <code>onLoad</code> since the reference text is generated at document load time
@attr action what should happen when the user clicks the reference text

<dl>
    <dt>none</dt>
        <dd>nothing happens, only the text is displayed</dd>
    <dt>jump</dt>
        <dd>the document is repositioned in the viewport so that the reference target is in view</dd>
</dl>

@attr embed specifies how the reference to the target should be displayed in text form. The available values are formed in some sort of regular pattern
and correspond to the available field options of Word's <code>REF</code> resp. <code>PAGEREF</code> field. The pattern structure:

<code>['rel'|''] ['page'|'context'|'note'|''] ['number'|'docvariable'] ['notext']</code>

Please confer this table for available combinations:

<table summary="embed attribute value matrix">
    <thead>
        <tr>
            <th colspan="7">Word <code>REF</code>/<code>PAGEREF</code> switches and translations </th>
        </tr>
        <tr>
            <th colspan="7" height="1" class="ruler"> </th>
        </tr>
        <tr>
            <th >w</th>
            <th >t</th>
            <th >r</th>
            <th >n</th>
            <th >p</th>
            <th > h </th>
            <th >
                <code>embed</code> attribute value </th>
        </tr>
        <tr>
            <th colspan="7" height="1" class="ruler"> </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>contextnumber</td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td></td>
            <td>number <em>(same as \w, but reference to user textmarker)</em></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td></td>
            <td></td>
            <td>number <em>(same as \w, but reference to user textmarker)</em></td>
        </tr>
        <tr>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td></td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>relcontextnumber</td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>relnumber</td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>relnumber</td>
        </tr>
        <tr>
            <td>
                <div align="center">x</div>
            </td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>contextnumbernotext</td>
        </tr>
        <tr>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td></td>
            <td>numbernotext <em>(same as \w, but reference to user textmarker)</em></td>
        </tr>
        <tr>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td></td>
            <td></td>
            <td>numbernotext <em>(same as \w, but reference to user textmarker)</em></td>
        </tr>
        <tr>
            <td>
                <div align="center">x</div>
            </td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>relcontextnumbernotext</td>
        </tr>
        <tr>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>relnumbernotext</td>
        </tr>
        <tr>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>relnumbernotext</td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>pagenumber <em>(when field type = <code>PAGEREF</code>)</em></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>relpagenumber <em>(when field type = <code>PAGEREF</code>)</em></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>docvariable <em>(when type = <code>REF</code>)</em></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td>reldocvariable <em>(when type = <code>REF</code>)</em></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td> notenumber <em>(generated by <code>NOTEREF</code> field type)</em> </td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>
                <div align="center">x</div>
            </td>
            <td></td>
            <td> relnotenumber <em>(generated by <code>NOTEREF</code> field type)</em> </td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td><div align="center" /></td>
        </tr>
        <tr>
            <td>
                <div align="center"> </div>
            </td>
            <td>
                <div align="center"> </div>
            </td>
            <td>
                <div align="center"> </div>
            </td>
            <td>
                <div align="center"> </div>
            </td>
            <td>
                <div align="center"> </div>
            </td>
            <td>
                <div align="center">x</div>
            </td>
            <td><em>sets <code>action</code> attribute to value <code>jump</code></em></td>
        </tr>
    </tbody>
</table>

-->
<!ATTLIST reference xlink:type NMTOKEN #FIXED "simple"
                    xlink:show NMTOKEN #FIXED "other"
                    xlink:actuate NMTOKEN #FIXED "onLoad"
                    xlink:href CDATA #IMPLIED
                    action (none|jump) #IMPLIED
                    embed (relpagenumber|pagenumber|number|contextnumber|relnumber|relcontextnumber|numbernotext|contextnumbernotext|relnumbernotext|relcontextnumbernotext|docvariable|reldocvariable|notenumber|relnotenumber|rel) "pagenumber"
                    %common.att;
>

<!-- 
a footnote

<strong>Note</strong> that entering a footnote should reset any style info in effect outside of it, i.e. a processing application
should not perform inheritance into a <code>footnote</code> element.
-->
<!ELEMENT footnote (%subdoc.mdl;)*>

<!ATTLIST footnote %common.att;
>

<!-- 
an endnote

<strong>Note</strong> that entering an endnote should reset any style info in effect outside of it, i.e. a processing application
should not perform inheritance into a <code>endnote</code> element.
-->
<!ELEMENT endnote (%subdoc.mdl;)*>
<!ATTLIST endnote %common.att;
>

<!-- 
This element represents a textbox, i.e. a (often floating), out-of-flow piece of content. It corresponds to
Word's text field object resp. positioned paragraphs (for which support is currently only limited in upCast).
-->
<!ELEMENT textbox (%subdoc.mdl;)*>
<!ATTLIST textbox %common.att;
>

<!-- 
Represents an RTF document's annotation.
-->
<!ELEMENT annotation (%subdoc.mdl;)*>

<!--
@attr authorname the full name of the author who created the annotation
@attr authorid a short authorid for that author
-->
<!ATTLIST annotation authorname CDATA   #IMPLIED
                     authorid   NMTOKEN #IMPLIED
                     %common.att;
>

<!-- 
identifies content that was inserted while track changes was in effect.
-->
<!ELEMENT inserted (#PCDATA | %inline.mdl;)*>

<!--
@attr authorname the full name of the author who inserted the content
@attr author a short author id for that author
@attr date the date when the insertion happened as an RFC compliant string
-->
<!ATTLIST inserted authorname CDATA   #IMPLIED
                   author   CDATA #IMPLIED
                   date     CDATA #IMPLIED
                   %common.att;
>

<!-- 
identifies content that was deleted while track changes was in effect.
-->
<!ELEMENT deleted (#PCDATA | %inline.mdl;)*>

<!--
@attr authorname the full name of the author who deleted the content
@attr author a short author id for that author
@attr date the date when the deletion happened as an RFC compliant string
-->
<!ATTLIST deleted authorname CDATA   #IMPLIED
                  author   CDATA #IMPLIED
                  date     CDATA #IMPLIED
                  %common.att;
>

<!-- 
<code>gentext</code> stands for <em>generated text</em>. This element is written in response to
calculated fields in the original document. 
-->
<!ELEMENT gentext (#PCDATA | %inline.mdl;)*>

<!--
@attr type the type of field; this is the main instruction part of the field like <code>PAGE</code>, <code>EQ</code> or <code>IF</code>.
@attr data the data ("parameters") of the field. upCast flattens nested fields by enclosing their complete definitions in braces <code>{...}</code>,
you will therefore not get nested <code>gentext</code> elements.

The following <code>type</code> strings are used by upCast/downCast for special purposes:
<dl>
    <dt>upcast-HEADINGNUMBER</dt>
        <dd>marks up the generated numbering info for headings so you can easily discard or replace this numbering with a new one created at publishing time</dd>
    <dt>upcast-FOOTNOTENUMBER</dt>
        <dd>marks the place where the footnote number automatically generated by Word at display/rendering time should be inserted</dd>
    <dt>upcast-ENDNOTENUMBER</dt>
        <dd>marks the place where the endnote number automatically generated by Word at display/rendering time should be inserted</dd>
    <dt>upcast-ANNOTATIONNUMBER</dt>
        <dd>marks the place where the annotation number automatically generated by Word at display/rendering time should be inserted</dd>
</dl>
-->
<!ATTLIST gentext type CDATA #IMPLIED
                  data CDATA #IMPLIED
                  %common.att;
>

<!-- 
Marks a specifc location in the document by name.
-->
<!ELEMENT target EMPTY>

<!--
@attr id the target ID
-->
<!ATTLIST target id ID #IMPLIED
>

<!-- 
Marks the end of a portion of a document that was started by a <code>target</code> element with the same ID earlier.

<strong>Background info:</strong> Word allows creating so called bookmarks over arbitrary ranges of content in a document.
Specifically, these ranges need not be properly nested in any way. Since we cannot express this faithfully in XML which requires
wellformedness, the <code>endtarget</code> element mechanism is a way to at least indicate what portion of the original document
was part of that named bookmark (span).
-->
<!ELEMENT endtarget EMPTY>

<!--
@attr id this attribute of type <code>IDREF</code> must point to the corresponding <code>target</code> element where this named
bookmark (span, range) started.
-->
<!ATTLIST endtarget id IDREF #IMPLIED
>

<!-- 
This element repesents a Hyperlink, inserted into a document using the Insert Hyperlink function and which effectively
creates a <code>HYPERLINK</code> field. -->
<!ELEMENT link (#PCDATA | %inline.mdl;)*>

<!--
@attr xlink:type the XLink link type; always <code>simple</code>
@attr xlink:href the URL to the hyperlink destination
@attr xlink:show the XLink show method; always <code>replace</code>
@attr xlink:actuate the XLink actuate behaviour; always <code>onRequest</code> since the link is only traversed upon request (usually, by clicking on it)
@attr title text that is displayed a a hint where the link will go; usually displayed as a help tag when hovering over it
-->
<!ATTLIST link xlink:type NMTOKEN #FIXED "simple"
               xlink:show NMTOKEN #FIXED "replace"
               xlink:actuate NMTOKEN #FIXED "onRequest"
               xlink:href CDATA #IMPLIED
               title CDATA #IMPLIED
               %common.att;
>               

<!-- 
a forced line break in inline content
-->
<!ELEMENT linebreak EMPTY>

<!--
@attr type the type of the line break:
<dl>
    <dt>clearleft</dt>
        <dd>creates a forced line break in the current paragraph, moving down until the left side is cleared</dd>
    <dt>clearright</dt>
        <dd>creates a forced line break in the current paragraph, moving down until the right side is cleared</dd>
    <dt>clearall</dt>
        <dd>creates a forced line break in the current paragraph, moving down until both the left and right side are cleared</dd>
</dl>
-->
<!ATTLIST linebreak type (clearleft|clearright|clearall) #IMPLIED>

<!-- 
a forced pagebreak

<strong>Note</strong> that y setting appropriate options in upCast (<em>Use CSS for forced page breaks</em>), you can choose 
whether you want the explicit <code>pagebreak</code> elements in the output or just appropriate CSS styling using <code>page-break-before: always;</code>

-->
<!ELEMENT pagebreak EMPTY>

<!-- 
a forced column break
-->
<!ELEMENT columnbreak EMPTY>


<!--
This element will only ever be written when you pre-process your documents with WordLink and have
the option <em>Mark up layout pagebreaks using <pagestart/></em> turned on.

It then identifies the
places in the document where at WordLink processing time, the dynamically calculated, numbered page breaks were located (and
where an upCast custom macro placed identifying markers into the document using a VBA script).

<strong>Be warned</strong> that this is a fragile information, which might depend on the configuration of the machine
where you run upCast and the configuration of attached printers to that machine. Normally, there's no way for
upCast to determine where a physical, dynamic page break will occur when the document is rendered.
-->
<!ELEMENT pagestart EMPTY>

<!--
@attr pagenumber the page number in the document
-->
<!ATTLIST pagestart pagenumber CDATA #IMPLIED
>

<!-- 
This element will only ever be written when you pre-process your documents with WordLink and have
the option <em>Mark up layout linebreaks using <linestart/></em> turned on.

It then identifies the
places in the document where at WordLink processing time, the dynamically calculated, numbered lines were located (and
where an upCast custom macro placed identifying markers into the document using a VBA script).

<strong>Be warned</strong> that this is a fragile information, which might depend on the configuration of the machine
where you run upCast and the configuration of attached printers to that machine. Normally, there's no way for
upCast to determine where a physical, dynamic line break will occur when the document is rendered.
-->
<!ELEMENT linestart EMPTY>

<!--
@attr linenumber the line number in the document
-->
<!ATTLIST linestart linenumber CDATA #IMPLIED
>


<!-- 
This element identifies an index target, i.e. a location where an entry in a (to be generated) index
will point to. It is created based on index entry information present in the original document.
-->
<!ELEMENT indextarget (#PCDATA | see | %inline.mdl;)*>

<!--
@attr entryLevel1 the top-level index entry
@attr entryLevel2 the second-level index entry
@attr entryLevel3 the third-level index entry
@attr entryLevel4 the fourth-level index entry
@attr entryLevel5 the fifth-level index entry
@attr entryLevel6 the sixth-level index entry
@attr entryLevel7 the seventh-level index entry
@attr entryLevel8 the eighth-level index entry
@attr entryLevel9 the nineth-level index entry
@attr significance the significance of the index entry:
<dl>
    <dt>normal</dt>
        <dd>a normal reference for that entry</dd>
    <dt>preferred</dt>
        <dd>the main or preferred reference for that entry; usually rendered bold in print</dd>
    <dt>graphic</dt>
        <dd>a reference to a graphic for that entry; usually rendered italic in print</dd>
</dl>
-->
<!ATTLIST indextarget entryLevel1 CDATA #IMPLIED
                      entryLevel2 CDATA #IMPLIED
                      entryLevel3 CDATA #IMPLIED
                      entryLevel4 CDATA #IMPLIED
                      entryLevel5 CDATA #IMPLIED
                      entryLevel6 CDATA #IMPLIED
                      entryLevel7 CDATA #IMPLIED
                      entryLevel8 CDATA #IMPLIED
                      entryLevel9 CDATA #IMPLIED
                      significance NMTOKENS 'normal'
                      %common.att;
>

<!-- 
instead of rendering e.g. a page reference to the occurrence of the <code>indextarget</code>,
the content of this element is written for this entry into the index
-->
<!ELEMENT see (#PCDATA | %inline.mdl;)*>

<!-- 
the content of the page header

You can define four types of headers: one for all pages, one for the first page, one for even and one for odd pages.
-->
<!ELEMENT pageheader (%subdoc.mdl;)*>

<!--
@attr type the type of header to be defined

<dl>
    <dt>all</dt>
        <dd>this header will appear on all pages when no other headers have been defined</dd>
    <dt>firstpage</dt>
        <dd>this header will appear only on the first page of a <code>part</code></dd>
    <dt>evenpages</dt>
        <dd>this header will appear only on even numbered pages</dd>
    <dt>oddpages</dt>
        <dd>this header will appear only on odd numbered pages</dd>
        
</dl>
-->
<!ATTLIST pageheader type (all | firstpage | evenpages | oddpages) #REQUIRED
                     %common.att;
>

<!--
the content of the page footer

You can define four types of footers: one for all pages, one for the first page, one for even and one for odd pages.
-->
<!ELEMENT pagefooter (%subdoc.mdl;)*>

<!--
@attr type the type of footer to be defined

<dl>
    <dt>all</dt>
        <dd>this footer will appear on all pages when no other headers have been defined</dd>
    <dt>firstpage</dt>
        <dd>this footer will appear only on the first page of a <code>part</code></dd>
    <dt>evenpages</dt>
        <dd>this footer will appear only on even numbered pages</dd>
    <dt>oddpages</dt>
        <dd>this footer will appear only on odd numbered pages</dd>
        
</dl>
-->
<!ATTLIST pagefooter type (all | firstpage | evenpages | oddpages) #REQUIRED
                     %common.att;
>

<!--
This element wraps the Table Of Contents of the original document, if it is present and automatically
generated by Word. -->
<!ELEMENT toc (%subdoc.mdl;)*>

<!--
@attr data any additional formatting instructions for the ToC; this field is the equivalent to <code>gentext</code>'s data attribute
-->
<!ATTLIST toc data CDATA #IMPLIED
              %common.att;
>

<!-- 
a text field form, as available through Word's forms palette
-->
<!ELEMENT formtext (%subdoc.mdl;)*>

<!--
@attr textType the type of text that this form field accepts
@attr maxChars the maximum number of characters accepted for input
@attr name the name of the form field
@attr defaultValue the default value
@attr styleName the name of a style this field is associated with
@attr helpText text that should be displayed to user for helping him filling out the form field correctly
@attr statuslineText text displayed in the status line when in this field
@attr protected determines whether this form field is protected
@attr hasListbox determines if this field has a list box
-->
<!ATTLIST formtext  textType (regular | number | date | currentDate | currentTime | calculation) #IMPLIED
                    maxChars CDATA #IMPLIED
                    name CDATA #IMPLIED
                    defaultValue CDATA #IMPLIED
                    styleName CDATA #IMPLIED
                    helpText CDATA #IMPLIED
                    statuslineText CDATA #IMPLIED
                    protected (true | false) #IMPLIED
                    hasListbox (true | false) #IMPLIED
                    %common.att;
>

<!-- 
a checkbox form, as available through Word's forms palette
-->
<!ELEMENT formcheckbox EMPTY>

<!--
@attr name the name of the form field
@attr defaultValue the default value
@attr selectedValue the value the user has selected
@attr styleName the name of a style this field is associated with
@attr helpText text that should be displayed to user for helping him filling out the form field correctly
@attr statuslineText text displayed in the status line when in this field
@attr protected determines whether this form field is protected
@attr hasListbox determines if this field has a list box
-->
<!ATTLIST formcheckbox  name CDATA #IMPLIED
                        defaultValue CDATA #IMPLIED
                        selectedValue CDATA #IMPLIED
                        helpText CDATA #IMPLIED
                        statuslineText CDATA #IMPLIED
                        protected (true | false) #IMPLIED
                        hasListbox (true | false) #IMPLIED
                        %common.att;
>

<!-- 
a popup menu form, as available through Word's forms palette
-->
<!ELEMENT formdropdown (choiceList)>

<!--
@attr name the name of the form field
@attr defaultValue the default value
@attr styleName the name of a style this field is associated with
@attr selectedValue the value the user has selected
@attr helpText text that should be displayed to user for helping him filling out the form field correctly
@attr statuslineText text displayed in the status line when in this field
@attr protected determines whether this form field is protected
@attr hasListbox determines if this field has a list box
-->
<!ATTLIST formdropdown  name CDATA #IMPLIED
                        defaultValue CDATA #IMPLIED
                        selectedValue CDATA #IMPLIED
                        helpText CDATA #IMPLIED
                        statuslineText CDATA #IMPLIED
                        protected (true | false) #IMPLIED
                        hasListbox (true | false) #IMPLIED
                        %common.att;
>

<!-- 
the container for a <code>formdropdown</code> field's menu choices
-->
<!ELEMENT choiceList (choice)*>

<!--
a single menu entry, resp. choice value
-->
<!ELEMENT choice (#PCDATA)>

<!--
@attr index the position in the list
-->
<!ATTLIST choice index CDATA #IMPLIED
>

<!--
This element represents an embedded object (OLE object) in an RTF document. It acts as a container
for multiple representations of that single object (like an image representation or the original
binary data stream). Processing applications are expected to pick the most appropriate top-level
child of this element for further processing.
-->
<!ELEMENT object (image?,ole?)>

<!--
@attr type the type of the object
@attr subtype the subtype of the object
-->
<!ATTLIST object  %common.att;
                  %class.att;
                  type CDATA #IMPLIED
                  subtype CDATA #IMPLIED
>
                     
<!-- 
This object contains the binary data stream of an OLE object, encoded as base64 character stream.
-->
<!ELEMENT ole (#PCDATA)*>

<!--
@attr type the type of the object
<dl>
    <dt>emb</dt>
        <dd>an object type of OLE embedded object</dd>
    <dt>link</dt>
        <dd>an object type of OLE link</dd>
    <dt>autlink</dt>
        <dd>an object type of OLE autolink</dd>
    <dt>sub</dt>
        <dd>an object type of Macintosh Edition Manager subscriber</dd>
    <dt>pub</dt>
        <dd>an object type of Macintosh Edition Manager publisher</dd>
    <dt>icemb</dt>
        <dd>an object type of MS Word for the Macintosh Installable Command (IC) Embedder</dd>
    <dt>html</dt>
        <dd>an object type of Hypertext Markup Language (HTML) control</dd>
    <dt>ocx</dt>
        <dd>An object type of OLE control</dd>
</dl>
@attr linkself when true, the object is a link to another part of the same document
@attr locked when true, locks the object from any updates
@attr update forces an update to the object before displaying it
@attr resultformatting when <code>keep</code>, uses the formatting of the current result whenever a new result is obtained
@attr resulttype
<dl>
    <dt>rtf</dt>
        <dd>Forces the result to be RTF, if possible</dd>
    <dt>txt</dt>
        <dd>Forces the result to be plain text, if possible</dd>
    <dt>pict</dt>
        <dd>Forces the result to be a Windows metafile or MacPict image format, if possible</dd>
    <dt>bmp</dt>
        <dd>Forces the result to be a bitmap, if possible</dd>
    <dt>html</dt>
        <dd>Forces the result to be HTML, if possible</dd>
</dl>
@attr setsize when true, forces the object server to set the object's dimensions to the size specified by the client
@attr align the distance in twips from the left edge of the objects that should be aligned on a tab stop. This is needed to place Equation Editor equations correctly.
@attr trans-y the distance in twips the objects should be moved vertically with respect to the baseline. This is needed to place Math Type equations correctly.
@attr height the original object height in twips, assuming the object has a graphical representation
@attr width the original object width in twips, assuming the object has a graphical representation
@attr crop-top the top cropping value in twips
@attr crop-bottom the bottom cropping value in twips
@attr crop-left the left cropping value in twips
@attr crop-right the right cropping value in twips
@attr scale-x the horizontal scaling percentage
@attr scale-y the vertical scaling percentage
@attr objectclass the object class to use for this object
@attr name name of this object
@attr time the time that the object was last updated
-->
<!ATTLIST ole  
                  type              (emb | link | autlink | sub | pub | icemb | html | ocx) #IMPLIED
                  linkself          (true | false)      'false'
                  locked            (true | false)      'false'
                  update            (true | false)      'false'
                  resultformatting  (keep | replace)    'replace'
                  resulttype        (rtf | txt | pict | bmp | html)   #IMPLIED
                  setsize           (true | false)      'false'
                  align             CDATA               #IMPLIED
                  trans-y           CDATA               #IMPLIED
                  height            CDATA               #IMPLIED
                  width             CDATA               #IMPLIED
                  crop-top          CDATA               #IMPLIED
                  crop-bottom       CDATA               #IMPLIED
                  crop-left         CDATA               #IMPLIED
                  crop-right        CDATA               #IMPLIED
                  scale-x           CDATA               #IMPLIED
                  scale-y           CDATA               #IMPLIED
                  objectclass       CDATA               #IMPLIED
                  name              CDATA               #IMPLIED
                  time              CDATA               #IMPLIED
                  %common.att;
>

<!-- 
This element is a universal container, not ever written by upCast, but recognized and processed by downCast.

You can use this for easily grouping elements and e.g. apply the same amount of indent using CSS. This is
often handy since RTF itself does not support a box model, but measures all of its distances from the 0 left margin.
This element eases your calculation tasks by giving you a new offset for a group of several items. You can also use
this element as a starting point for inheriting CSS properties on its children (restrictions in support of CSS inheritance
rules apply to the current version of downCast, though).
 -->
<!ELEMENT block (%section.mdl;)*>
<!ATTLIST block  %common.att;
                 %class.att;
>

<!-- 
This alement can be used to place a CSS stylesheet inline into the document it should be applied to,
therefore making a document completely self-contained (including its styling and layout information).
You can set some of the export filters of upCast to generate the styles inline, instead of linking to
an external CSS stylesheet.
-->
<!ELEMENT style (#PCDATA)>

<!--
@attr type the mime type of the used stylesheet language; for upCast, this is <code>text/css</code>
@attr media the media to which this stylesheet should apply; downCast applies <code>print</code> and general stylesheets
-->
<!ATTLIST style  %common.att;
                 %class.att;
                 type    CDATA   #REQUIRED
                 media   CDATA   #IMPLIED
>


<!-- 
The literal element is only used by downCast. You can use it to introduce literal RTF code into the generated document
at the position where the literal element is placed in the XML document. If possible, you should try to create the
desired output without using this element. However, in some cases, it might be necessary to resort to this mechanism,
e.g. when a specific, required construct in the RTF document can not (yet) be created directly in downCast using a supported 
way or property.
-->
<!ELEMENT literal EMPTY>

<!--
@attr data the literal RTF code to be inserted at this place in the document's output stream.
%
    <document ...>
        <literal data="\viewkind2 "/>
        ...
    </document>
%
Requests that the document always be opened in Word's outline view mode.
-->
<!ATTLIST literal data CDATA #IMPLIED>


<!-- 
The partbreak element is only used by downCast. You can use it to place a Word section break anywhere in the normal document
flow without having to group the generated <part>'s content. This is useful when you want to use parts just for formatting
reasons (e.g., switching between different column configurations or page sizes). You can attach the same attributes as
on the <part> element.
-->
<!ELEMENT partbreak EMPTY>
<!ATTLIST partbreak %common.att;
                    %class.att;
>

<!-- End -->