<!--
    User Interface Markup Language (UIML)
    =====================================

    Developed by:
    
        Harmonia, Inc.

    Authors:

        Constantinos Phanouriou (phanouri@universalit.com)
        Alan L. Batongbacal
        Marc Abrams (abrams@universalit.com)

    Usage:

        <?xml version="1.0"?>
        <!DOCTYPE uiml PUBLIC
            "-//Harmonia//DTD UIML 2.0a Draft//EN"
            "http://uiml.org/dtds/UIML2_0a.dtd">

        <uiml>
          <head> ... </head>
          <peers> ... </peers>
          <template> ... </template>
          <interface> ... </interface>
        </uiml>

    Description:

        This DTD corresponds to the UIML 2.0a specification,
        which may be found at the following URL:

            http://www.uiml.org/docs/uiml20

    Change History:
        16 Jan 2000 - M Abrams (abrams@uiml.org)
                    - Changed "href" attribute back to old name, "source"
                    - Changed "task" tag back to old name, "call"
        08 Oct 1999 - C Phanouriou (phanouri@universalit.com)
                    - Updated DTD to UIML spec version "2.0a"
                    - Major changes and tag renaming
                    - Added support for templates and peer components
        31 Jul 1999 - A Batongbacal (alanlb@universalit.com)
                    - Updated DTD to UIML spec version "2.0"
        24 Jul 1999 - M Abrams (abrams@uiml.org)
                    - updated to revised language
        15 Jul 1999 - C Phanouriou (phanouri@universalit.com)
                    - first draft
-->

<!-- ==================== Entities ======================= -->

<!-- Template related attributes -->

<!ENTITY % SourceModes "(append|cascade|replace) 'replace'">

<!-- Export options for elements inside a template -->
<!ENTITY % ExportOptions
   "export     (hidden|optional|required)  'optional'">

<!ENTITY % SourceAttributes 
   "name      NMTOKEN      #IMPLIED
    source    CDATA        #IMPLIED
    how      %SourceModes;
    %ExportOptions;">

<!-- Elements that can be inside a template -->
<!ENTITY % SourceElements
   "(behavior|component|constant|content|interface|logic
   |part|peers|presentation|property|rule|script|structure|style)">


<!-- Type options for methods -->
<!ENTITY % TypeOptions
   "type      (input|output|inout|none) 'inout'">


<!-- ==================== Content Models ======================= -->

<!--
    'uiml' is the root element of a UIML document.
-->

<!ELEMENT uiml (head?, peers?, template*, interface?)>

<!--
    The 'head' element is meant to contain metadata about the UIML
    document.  You can specify metadata using the meta tag,
    this is similar to the head/meta from HTML.
-->

<!ELEMENT head (meta)*>
<!ELEMENT meta EMPTY>
<!ATTLIST meta
   name      NMTOKEN  #REQUIRED
   content   CDATA    #REQUIRED>

<!--
    The 'peers' element contains information that defines
    how a UIML interface component is mapped to the target platform's
    rendering technology and to the backend logic.
-->

<!ELEMENT peers (presentation|logic)*>
<!ATTLIST peers
   %SourceAttributes;>

<!--
    The 'template' element allows reuse of UIML elements.
    When an element appears inside a template element it can
    sourced by another element with the same tag.
-->

<!ELEMENT template %SourceElements;>
<!ATTLIST template
   name   NMTOKEN #IMPLIED>

<!--
    The 'interface' element describes a user interface in terms of
    presentation cues, component structure and behavior specifications.
-->

<!ELEMENT interface (structure|style|content|behavior)*>
<!ATTLIST interface
   %SourceAttributes;>

<!-- Peer related elements -->

<!--
    The 'presentation' element specifies the mapping between 
    abstract interface parts and platform dependent widgets.
-->

<!ELEMENT presentation (component*)>
<!ATTLIST presentation
   %SourceAttributes;>

<!--
    The 'logic' element specifies the connection between the interface
    and the backend application, including support for scripting.
-->

<!ELEMENT logic (component*)>
<!ATTLIST logic
   %SourceAttributes;>

<!--
    The 'component' element represents components either in the backend
    (e.g., a class in an object oriented language) or components from
    a renderable toolkit (e.g., a widget)
-->
<!ELEMENT component (attribute|method)*>
<!ATTLIST component
   %SourceAttributes;
   maps-to    CDATA  #IMPLIED>

<!--
   The 'attribute' element 
-->
<!ELEMENT attribute (method*)>
<!ATTLIST attribute
   name        NMTOKEN  #REQUIRED>

<!--
   
-->
<!ELEMENT method (param*, returns?, script?)>
<!ATTLIST method
   %SourceAttributes;
   maps-to    CDATA   #IMPLIED
   %TypeOptions;>

<!--
    'Param' denotes a single formal or actual parameter to a function.
-->

<!ELEMENT param EMPTY>
<!ATTLIST param
    name   NMTOKEN  #IMPLIED>


<!--
    The 'returns' element marks the return value of a callable function.
-->

<!ELEMENT returns EMPTY>
<!ATTLIST returns
    name   NMTOKEN  #IMPLIED>

<!--
    The 'script' element contains data passed to an embedded scripting
    engine. The type specifies the scripting language (see HTML4.0)
-->

<!ELEMENT script (#PCDATA)>
<!ATTLIST script
   %SourceAttributes;
   type    NMTOKEN #IMPLIED>




<!-- Interface related elements -->

<!--
    The 'structure' element describes the initial logical relationships
    between the components (i.e., the "part"s) that comprise the user
    interface.
-->

<!ELEMENT structure (part*)>
<!ATTLIST structure
   %SourceAttributes;>

<!--
    A 'part' element describes a conceptually complete component of the
    user interface.
-->

<!ELEMENT part (style?, content?, behavior?, part*)>
<!ATTLIST part
   %SourceAttributes;
   class    NMTOKEN  #IMPLIED>

<!--
    A 'style' element is composed of one or more 'property' elements,
    each of which specifies how a particular aspect of an interface
    component's presentation is to be presented.
-->

<!ELEMENT style (property*)>
<!ATTLIST style
   %SourceAttributes;>

<!--
    A 'property' element is typically used to set a specified
    property for some interface component (or alternatively,
    a class of interface components), using the element's
    character data content as the value.  If the 'operation'
    attribute is given as "get", the element is equivalent to
    a property-get operation, the value of which may be "returned"
    as the content for an enclosing 'property' element.
-->

<!ELEMENT property (#PCDATA|constant|property|reference|call)*>
<!ATTLIST property
   %SourceAttributes;
   part-name      NMTOKEN #IMPLIED
   part-class     NMTOKEN #IMPLIED
   event-name     NMTOKEN #IMPLIED
   event-class    NMTOKEN #IMPLIED
   call-name      NMTOKEN #IMPLIED
   call-class     NMTOKEN #IMPLIED>


<!--
    A 'reference' may be thought of as a property-get operation,
    where the "property" to be read is a 'constant' element defined
    in the UIML document's 'content' section.
-->

<!ELEMENT reference EMPTY>
<!ATTLIST reference
   constant-name  NMTOKEN #REQUIRED>

<!--
    The 'content' element is composed of one or more 'constant'
    elements, each of which specifies some fixed value.
-->

<!ELEMENT content (constant*)>
<!ATTLIST content
   %SourceAttributes;>

<!--
    'Constant' elements may be hierarchically structured.
-->

<!ELEMENT constant (#PCDATA|constant)*>
<!ATTLIST constant
   %SourceAttributes;>

<!--
    The 'behavior' element gives one or more "rule"s that
    specifies what 'action' is to be taken whenever an associated
    'condition' becomes TRUE.
-->

<!ELEMENT behavior (rule*)>
<!ATTLIST behavior
   %SourceAttributes;>


<!ELEMENT rule (condition,action)?>
<!ATTLIST rule
   %SourceAttributes;>

<!--
    At the moment, "rule"s may be associated with two types of
    conditions: (1) whenever some expression is equal to some other
    expression; and (2) whenever some event is triggered and caught.
-->

<!ELEMENT condition (equal|event)>
<!ELEMENT equal (event,(constant|property|reference))>

<!ELEMENT action ((property|call)*, event?)>

<!ELEMENT call (param*)>
<!ATTLIST call
   name        NMTOKEN #IMPLIED
   class       NMTOKEN #IMPLIED>

<!ELEMENT event EMPTY>
<!ATTLIST event
   part-name   NMTOKEN #IMPLIED
   part-class  NMTOKEN #IMPLIED
   name        NMTOKEN #IMPLIED
   class       NMTOKEN #IMPLIED>


<!-- Syntax under revision -->
<!ELEMENT system EMPTY>