Plasma GitLab Archive
Projects Blog Knowledge

<?xml version="1.0" encoding="ISO8859-1"?>

<!-- $Id: wd_application_1.dtd,v 3.2 2003-04-03 11:50:03 stolpmann Exp $ -->

<!-- This DTD should be referred to by the PUBLIC identifier:
     PUBLIC "-//NPC//DTD WDIALOG 1.1//EN"

     Version numbers: have the form major.minor; a change in a major
     number means that the versions are incompatible, while a
     change in the minor number means that the an application designed
     for a lower version number can also be parsed by the DTD with the
     higher version number (and it _should_ mean the same; however
     you should not rely on that).

     Table of PUBLIC IDs and CVS revision numbers:

     CVS revision         Corresponding PUBLIC ID
     ====================================================
     1.1 to 1.10          no assigned PUBLIC ID
     1.11                 "-//NPC//DTD WDIALOG 1.1//EN"
  -->


<!ENTITY % major-version "1">


<!ENTITY % nametoken 'CDATA'>
   <!-- This was NMTOKEN, but NMTOKEN does not allow the character "$" we
        need for the formal parameters. So use CDATA instead.
     -->


<!ELEMENT ui:application ( ui:object | ui:template )+ >

<!ATTLIST ui:application
          start-object %nametoken; #REQUIRED
>

<!-- ************************************************************ -->

<!ELEMENT ui:object ( ( ui:enumeration )*,
                      ( ui:declaration )?,
                      ( ui:default )?,
                      ( ui:page )+ ) >

<!ATTLIST ui:object
          name       %nametoken; #REQUIRED
          start-page %nametoken; #REQUIRED>

<!ELEMENT ui:enumeration ( ui:enum )*>

<!ATTLIST ui:enumeration
          name %nametoken; #REQUIRED>


<!ELEMENT ui:enum EMPTY>

<!ATTLIST ui:enum
          internal %nametoken; #REQUIRED
          external CDATA       #IMPLIED>

<!-- If "external" is left out, the default is to use the same value
     as for "internal.
  -->


<!ELEMENT ui:declaration ( ui:variable )* >

<!-- ui:declaration: no attributes -->


<!ENTITY % value-literal "(ui:string-value | ui:enum-value | ui:dyn-enum-value |
                           ui:alist-value)" >

<!ELEMENT ui:variable ( %value-literal; )? >

<!ATTLIST ui:variable
          name       %nametoken;   #REQUIRED
          type       %nametoken;   "string"
          temporary  (yes|no)      "no"
          associative (yes|no)     "no"
>

<!-- "type": either "string", "object", "dynamic-enumerator", or the name of
           a declared enumerator.
     "temporary": if "yes", the variable is not put into the
           persistent store.
  -->


<!-- NOTE dynamic enumerators:
     These have a different behaviour than declared enumerators. You can use
     them whereever an enumerator is allowed; but:

     - ui:checkbox, ui:radio, ui:select:
       A dynamic enumerator can be used to set up these interactors. After the
       page has been submitted, only those values of the enumerator are left
       which have been selected (the other values are lost forever). Only
       the internal values are sent back; the external values are lost.

       This has to do with the nature of dynamic enumerators; the base set of
       the enumerator is not known.

       In the case of ui:checkbox and ui:radio, two dynamic enumerators can
       be used to specify both the base set and the set of selected entries:

       <ui:template name="enum_template">
          <ui:checkbox variable="$v" value="$intern"/>$extern
       </ui:template>

       <ui:enumerate template="enum_template" variable="base_enum">
          <ui:param name="v">select_enum</ui:param>
       </ui:enumerate>


     - ui:select: to solve this problem, use the attribute "base"
  -->

<!-- VALUE LITERALS:
     necessary to specify default values in variable declarations
  -->


<!ELEMENT ui:string-value (#PCDATA)* >

<!ELEMENT ui:enum-value (ui:enum-item)* >

<!ELEMENT ui:enum-item EMPTY>

<!ATTLIST ui:enum-item
          internal  %nametoken;   #REQUIRED>

<!ELEMENT ui:dyn-enum-value (ui:dyn-enum-item)* >

<!ELEMENT ui:dyn-enum-item EMPTY>

<!ATTLIST ui:dyn-enum-item
          internal  %nametoken;   #REQUIRED
          external  CDATA         #IMPLIED >

<!-- If "external" is left out, the default is to use the same value
     as for "internal.
  -->

<!ELEMENT ui:alist-value (ui:alist-item)* >

<!ELEMENT ui:alist-item %value-literal; >

<!ATTLIST ui:alist-item
          index  CDATA #REQUIRED>


<!-- ************************************************************ -->

<!ELEMENT ui:page ANY>

<!-- actually: ELEMENT ui:page (ui:expectparam*, ANY) -->


<!ATTLIST ui:page
          name    %nametoken;  #REQUIRED
          replace (yes|no)     "no"
>

<!-- Parameter "replace":
     If "yes", $-parameters in pages are replaced by their current
     value (see ui:default to set values at this moment).
     You must declare parameters with ui:expectparam as within
     templates.
  -->


<!ELEMENT ui:popup EMPTY>
<!ATTLIST ui:popup
          page  %nametoken;  #REQUIRED>

<!-- Puts here the javascript code to define the popup window referring
     to the specified page:
     Javascript functions open_<pagename>(), and
     close_popups()
  -->

<!ELEMENT ui:server-popup EMPTY>
<!ATTLIST ui:server-popup
          page  %nametoken;  #REQUIRED>


<!ELEMENT ui:dynamic EMPTY>

<!ATTLIST ui:dynamic
          variable  %nametoken;     #REQUIRED
          index     CDATA           #IMPLIED
          type      (text|html)     "text">

<!-- insert the value of "variable". If type="text", meta characters
     (<, >, &, ") are expressed using the entities &lt; &gt; &amp;
     &quot;. If type="html" the value is inserted as it is.
  -->



<!ELEMENT ui:form ANY>

<!ATTLIST ui:form
          action-suffix CDATA "">  <!-- compat with DTD version 2 -->

<!-- ui:form: no attributes.
     An ui:form adds the necessary hidden fields, and automatically
     determines the <form> attributes.
  -->


<!ELEMENT ui:button EMPTY>

<!ATTLIST ui:button
          name  %nametoken; #REQUIRED
          index CDATA       #IMPLIED
          label CDATA       #IMPLIED
          goto  %nametoken; #IMPLIED
          cgi   (auto|keep) "auto"
>


<!-- Parameter "cgi":
     "auto" means that the names of CGI parameters are automatically
     determined. This is the default and works always, but you do not
     know the name of the CGI parameter.
     "keep" means that the names of CGI parameters are derived from the
     name of the element or the variable the element refers to. This
     option is incompatible with "index".
 -->

<!-- CGI parameters for buttons:
     cgi="auto", no index:      "button_<id>"
     cgi="auto", index="..."    "xbutton_<id>"
     cgi="keep", name="<name>"  "button_<name>"
  -->

<!-- planned:
     "indirect": 'yes' or 'no'. If 'yes', "goto" is interpreted as the
        the name of the variable containing the page name
     "save":  the name of a variable storing the current page
  -->


<!ELEMENT ui:imagebutton EMPTY>

<!ATTLIST ui:imagebutton
          name  %nametoken; #REQUIRED
          index CDATA       #IMPLIED
          src   CDATA       #REQUIRED
          align CDATA       #IMPLIED
          goto  %nametoken; #IMPLIED
          cgi   (auto|keep) "auto"
>

<!-- CGI parameters for imagebuttons:
     cgi="auto", no index:      "imagebutton_<id>"
     cgi="auto", index="..."    "ximagebutton_<id>"
     cgi="keep", name="<name>"  "imagebutton_<name>"
  -->

<!-- planned: see ui:button -->


<!ELEMENT ui:checkbox EMPTY>

<!ATTLIST ui:checkbox
          variable %nametoken; #REQUIRED
          index    CDATA       #IMPLIED
          value    %nametoken; #REQUIRED
          cgi     (auto|keep)  "auto"
>

<!-- The checkbox is "on" if the "value" is member of the enumeration
     "variable".
  -->

<!-- CGI parameters for checkboxes:
     cgi="auto", no index:          "var_<id>"
     cgi="auto", index="..."        "var_<id>"
     cgi="keep", variable="<name>"  "var_<name>"
  -->


<!ELEMENT ui:radio EMPTY>

<!ATTLIST ui:radio
          variable %nametoken; #REQUIRED
          index    CDATA       #IMPLIED
          value    %nametoken; #REQUIRED
          cgi     (auto|keep)  "auto"
>


<!-- The radio button is "on" if the "value" is member of the enumeration
     "variable". The radio buttons are glued together by their shared variable.
  -->

<!-- CGI parameters for radio buttons:
     cgi="auto", no index:          "var_<id>"
     cgi="auto", index="..."        "var_<id>"
     cgi="keep", variable="<name>"  "var_<name>"
  -->


<!ELEMENT ui:extern EMPTY>

<!ATTLIST ui:extern
          type   %nametoken; #REQUIRED
          intern %nametoken; #REQUIRED>

<!-- maps the internal value into an external value, for enumerator
     "type".
     This works only for declared enumerators.
  -->


<!ELEMENT ui:file EMPTY>

<!ATTLIST ui:file
          name     %nametoken; #REQUIRED
          cgi     (auto|keep)  "auto"
>


<!-- CGI parameters for file uploads:
     cgi="auto":                    "upload_<id>"
     cgi="keep", name="<name>"      "upload_<name>"
  -->

<!ELEMENT ui:password EMPTY>

<!ATTLIST ui:password
          variable  %nametoken; #REQUIRED
          index     CDATA       #IMPLIED
          maxlength CDATA       #IMPLIED
          size      CDATA       #IMPLIED
          cgi       (auto|keep) "auto"
>


<!-- CGI parameters for password elements:
     cgi="auto", no index:          "var_<id>"
     cgi="auto", index="..."        "var_<id>"
     cgi="keep", variable="<name>"  "var_<name>"
  -->

<!ELEMENT ui:text EMPTY>

<!ATTLIST ui:text
          variable  %nametoken; #REQUIRED
          index     CDATA       #IMPLIED
          maxlength CDATA       #IMPLIED
          size      CDATA       #IMPLIED
          cgi       (auto|keep) "auto"
>

<!-- CGI parameters for text boxes:
     cgi="auto", no index:          "var_<id>"
     cgi="auto", index="..."        "var_<id>"
     cgi="keep", variable="<name>"  "var_<name>"
  -->

<!ELEMENT ui:select EMPTY>

<!ATTLIST ui:select
          variable  %nametoken;  #REQUIRED
          index     CDATA        #IMPLIED
          multiple  (yes|no)     "no"
          size      CDATA        #IMPLIED
          base      %nametoken;  #IMPLIED
          baseindex CDATA        #IMPLIED
          cgi       (auto|keep)  "auto"
>

<!-- 'base' is the name of a variable containing the base set.
     If 'base' is left out, either the base set of the declared
     enumerator of the 'variable' is used, or the current value
     of the dynamic enumerator 'variable'.
  -->

<!-- CGI parameters for selection boxes:
     cgi="auto", no index:          "var_<id>"
     cgi="auto", index="..."        "var_<id>"
     cgi="keep", variable="<name>"  "var_<name>"
  -->

<!ELEMENT ui:textarea ANY>

<!ATTLIST ui:textarea
          variable  %nametoken;  #REQUIRED
          index     CDATA        #IMPLIED
          rows      CDATA        #IMPLIED
          cols      CDATA        #IMPLIED
          wrap      (off|hard|soft)  "off"
          cgi       (auto|keep)  "auto"
>

<!-- CGI parameters for text areas:
     cgi="auto", no index:          "var_<id>"
     cgi="auto", index="..."        "var_<id>"
     cgi="keep", variable="<name>"  "var_<name>"
  -->

<!ELEMENT ui:a ANY>

<!ATTLIST ui:a
          name  %nametoken;  #REQUIRED
          index CDATA        #IMPLIED
          goto  %nametoken;  #IMPLIED
          cgi   (auto|keep)  "auto"
>


<!-- ui:a: Although a hyperlink, it generates a Button event -->

<!-- CGI parameters for anchors:
     cgi="auto", no index:          "anchor_<id>"
     cgi="auto", index="..."        "xanchor_<id>"
     cgi="keep", name="<name>"      "anchor_<name>"
  -->


<!ELEMENT ui:special ANY>

<!-- ui:special outputs the subnodes as raw HTML. No further ui:* elements
     are recognized (they are discarded).
     To include JavaScript, use:
     <ui:special><![CDATA[
        <script language=javascript>
        ...
        </script>
     ]]>
     </ui:special>
  -->

<!-- ************************************************************ -->

<!ELEMENT ui:guard ANY>

<!ATTLIST ui:guard
          variable %nametoken; #REQUIRED
          index    %nametoken; #IMPLIED
          value    CDATA       #REQUIRED
          op       (eq|ne)     "eq"
>

<!-- ************************************************************ -->


<!ELEMENT ui:template ANY>

<!-- actually: ELEMENT ui:template (ui:expectparam*, ANY) -->


<!ATTLIST ui:template
          name               %nametoken;  #REQUIRED
>

<!-- Within a template, use $param for (formal) parameters.
     NOTES ON PARAMETER PASSING:
     - Parameters are allowed either within an attribute, or between elements.
       Examples:
       <ui:template name="sample">
         <a href="$url">This is my link</a>
         $further_text
       </ui:template>
     - When a parameter inside an attribute is instantiated, the value is
       "flattened". This means that markup metacharacters and normal
       characters are not distinguished; both kinds of symbols are protected
       by entities if necessary.
       Example:
         If $url="<b>&amp;</b>",
            (i.e. <ui:param name="url"><b>&amp;amp;a</b></ui:param>) then
         <a href="$url">This is my link</a> is expanded to HTML:
         <a href="&lt;b&gt;&amp;amp;&lt;/b&gt;">This is my link</a>
     - Parameters between elements are passed in their internal representation;
       the difference between characters and metacharacters is kept.
       Example:
         if $further_text="<b>&amp;</b>", then
         $further_text   is expanded to HTML:
         <b>&amp;amp;</b>
     - Further instantiations are done only if needed (lazy evaluation).
  -->


<!ELEMENT ui:expectparam ANY>

<!ATTLIST ui:expectparam
          name     NMTOKEN           #REQUIRED
          scope    (lexical|dynamic)  "lexical"
          force-default (yes|no)      "no"
>

<!-- Within ui:expectparam you can specify the default value. It is
     used if there is no directly passed parameter (it is even used
     if the parameter is contained in the current context).

     scope="lexical": The parameter is not added to the current
                      context, but if it is already in the context,
                      the old value in the context is kept.
     scope="dynamic": The parameter is added to the current context,
                      and hides any previous instance of this
                      parameter occuring in the context

     To define an empty default value:

     <ui:expectparam name="..." scope="..."><![CDATA[]]></ui:expectparam>

     MIXING THE EFFECTS OF lexical AND dynamic SCOPE:

     1) MAKING A lexical PARAMETER dynamic:

     <ui:template name="a">
       <ui:expectparam name="x" scope="lexical"/>
       <ui:use template="b">
          <ui:param name="x">$x</ui:param>
       </ui:use>
     </ui:template>

     <ui:template name="b">
       <ui:expectparam name="x" scope="dynamic"/>
       $x
       <ui:use template="c"/>
     </ui:template>

     <ui:template name="c">
       <ui:expectparam name="x" scope="dynamic"/>
       $x
     </ui:template>

     - Template "a" must explicitly pass "x" to "b", because "b" does
       not find the value for "x" in the context (because it is not in
       the context).

     - Template "b" changes the scope to "dynamic". Because of this,
       it is not necessary to pass "x" explicitly to "c"; when "b" is
       being called, the value of "x" is added to the context

     - Template "c" finds the context value

     2) MAKING A dynamic PARAMETER lexical:

     <ui:template name="a">
       <ui:expectparam name="x" scope="dynamic"/>
       <ui:expectparam name="y" scope="dynamic"/>
       <ui:use template="b"/>
     </ui:template>

     <ui:template name="b">
       <ui:expectparam name="x" scope="lexical"/>
       <ui:expectparam name="y" scope="lexical">Q</ui:expectparam>
       $x $y
       <ui:use template="c"/>
     </ui:template>

     <ui:template name="c">
       <ui:expectparam name="x" scope="lexical"/>
       <ui:expectparam name="y" scope="lexical"/>
       $x $y
     </ui:template>

     - Template "a" has two dynamic parameters, "x" and "y". When "b"
       is called, both parameters have already been added to the
       context.

     - Template "b" finds values for "x" and "y" in the context - the
       fact that the parameters are declared as lexical does not
       change that inputs for parameters are also searched in the context.

       So "x" has the same value as "x" has in template "a".

       But "y" has also a default value. This default value has higher
       precedence than the value in the context, and because of this,
       "y" is "Q".

     - Template "c" is called without explicitly passing parameters.
       Because "b" did not add its parameters to the context, template
       "c" will see the same values as "a" did.

     In short terms, "lexical" means: I do not want that subsequently
     called templates see my values (unless parameters are passed
     explicitly); these subsequently called templates will see the old
     values the parameters had before they became "lexical".

     "dynamic" means: I want that my value becomes the default value
     of this parameter that will even be seen by subsequently called
     templates.

  -->



<!ELEMENT ui:use ( ui:param )* >

<!ATTLIST ui:use
          template %nametoken; #REQUIRED>


<!-- PROPOSAL:
     Erstes innere Element darf auch ein ui:template sein.
  -->

<!ELEMENT ui:iterate ( ( ui:param )*,
                       ( ui:iter-empty )?,
                       ( ui:iter-head )?,
                       ( ui:iter-foot )?,
                       ( ui:iter-separator )?
                     )
 >
<!--  ( ui:inline-template )? -->

<!ATTLIST ui:iterate
          template %nametoken; #REQUIRED
          variable %nametoken; #REQUIRED
          index    CDATA       #IMPLIED
>

<!-- uses the "template" several times.
     The variable must be a dynamic enumerator or an associative variable
     over strings.
     The special parameter "$intern" is used for the internal values/keys,
     the special parameter "$extern" for the external values.
  -->


<!ELEMENT ui:enumerate ( ( ui:param )*,
                         ( ui:iter-empty )?,
                         ( ui:iter-head )?,
                         ( ui:iter-foot )?,
                         ( ui:iter-separator )?
                       )
>

<!ATTLIST ui:enumerate
          template %nametoken; #REQUIRED
          type     %nametoken; #IMPLIED
          variable %nametoken; #IMPLIED
          index    CDATA       #IMPLIED
>

<!-- uses the "template" several times. "type" must be a declared enumerator.
     If "variable" is not present, all values of the enumerator are
     enumerated; the param "$intern" is the internal value, and
     "$extern" the external value.
     If "variable" is present, only the values stored in this variable
     are enumerated.
     The parameters passed using ui:param are added to
     "$intern", and "$extern".
     Either "variable" or "type" must be present; neither both nor none of
     them.
  -->


<!ELEMENT ui:iter-empty ANY>
<!ELEMENT ui:iter-head ANY>
<!ELEMENT ui:iter-foot ANY>
<!ELEMENT ui:iter-separator ANY>

<!-- If the iterator is applied to an empty set, and if ui:iter-empty
     is specified, the contents of ui:iter-empty are printed instead of
     the iterator output.

     Otherwise: Before iteration starts, the contents of ui:iter-head
     are printed (if present). Between every cycle the contents of
     ui:iter-separator are printed. After the iteration, the contents
     of ui:iter-foot are output.
  -->


<!ELEMENT ui:default ( ui:param )* >

<!-- Sets the default parameters for an object -->


<!ELEMENT ui:param ANY>

<!ATTLIST ui:param
          name  %nametoken;       #REQUIRED
>


<!-- Standard library -->

<!ELEMENT ui:library (ui:libtemplate)*>

<!ELEMENT ui:libtemplate ANY>

<!ATTLIST ui:libtemplate
          name               NMTOKEN  #REQUIRED
          from-caller        NMTOKENS #IMPLIED
          from-context       NMTOKENS #IMPLIED
          xml:lang           NMTOKEN  #IMPLIED
>

<!-- ui:libtemplate is like ui:template (version 2), with the following exception:

     a ui:libtemplate can be overridden by a ui:template with the same
     name
  -->


<?pxp:dtd optional-element-and-notation-declarations?>

<?pxp:dtd optional-attribute-declarations
      elements="ui:form ui:button ui:imagebutton ui:checkbox ui:radio
                ui:file ui:password ui:text ui:select ui:textarea ui:a"?>


This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml