<!--============================================================================
	File Type:     XML document type definition
	Application:   BeCyForm (form GUI for HTTP-based client/server-communication)
	Author:        Benjamin Bentmann (www.becyhome.de, benjamin.bentmann@becyhome.de)
	Date:          11.03.2003
	Document:      Form template
	Version:       1.0
=============================================================================-->

<!--============================================================================
	GENERAL
	
	- Spelling -
	According to the XML specification, the spelling of elements, attributes 
	and values is case-sensitive.
	For the form templates, the general spelling is lower case.
	
	- Character sets / Code-pages -
	The default character set for form templates is, as by XML specified, 
	Unicode (UTF-8/UTF-16).
	When using an editor which does not support UTF-8/UTF-16 one needs to 
	specify the applied code-page within the xml prolog using the 'encoding' 
	attribute (as can be seen at the beginning of this file). Code-pages 
	currently recognized by BeCyForm include the popular family of "ISO-8859-X" 
	code-pages and the native "Windows-125X" code-pages.
	Note that there is a small difference between the ISO code-pages and their
	corresponding Windows code-pages. While ISO does not define characters
	within the code range 128 to 159, Windows does so. For instance, the 
	common western Windows code-page "windows-1252" uses code 128 to represent 
	the Euro currency symbol. Therefore, for the simplicity of editing form 
	templates, one is encouraged to use the appropriate "windows-125X" 
	code-page which covers all characters one can enter in a non-Unicode aware 
	editor on a Windows operation system.
	Finally note, that the application due to compatibility reasons does not 
	use Unicode but 8 Bit characters and code-pages internally. Therefore, only
	characters within the client's default ANSI code-page will be displayed 
	properly (pure ASCII characters are part of every code-page and will always 
	be displayed properly). As long as the form template and the client use the 
	same code-page there will be no conversion problems.
	
	- Entities - 
	BeCyForm supports the following named entities to mask characters: 
	"&lt;" ("<"), "&gt;" (">"), "&amp;" ("&"), "&quot;" ("""), "&apos;" ("'"),
	"&nbsp;" (" ").
	Furthermore, the parser supports Unicode entities in decimal notation 
	("&#ddd;") and hexadecimal notation ("&#xhhhh;"). Note that due to 
	compatibility reasons the application internally converts such Unicode 
	characters into ANSI characters (using the client's default ANSI 
	code-page). Therefore the proper display of Unicode characters cannot be 
	guaranteed (regardless whether the client runs on a Unicode-aware operating
	system or not).
	
	- Raw text (PCDATA) -
	Almost every element allows raw text (PCDATA) to be enclosed within the 
	opening and closing tag of an element. This text is interpreted in two
	different ways. The actual semantic interpretation depends on the kind of 
	element.
	For inline elements (e.g. 'edit', i.e. elements that cannot contain nested 
	controls) this text is treated as an alternative value assignment for the 
	'text' attribute. That means the following lines are semantically equal:
		<label>Login:</label>
		<label text="Login:" />
	For block elements (e.g. 'frame', i.e. elements that can contain nested 
	controls) this text is treated as an alternative notation of the 'label'
	element. That means the following lines are semantically equal:
		<frame>Label1<br/>Label2</frame>
		<frame><label text="Label1" /><br/><label text="Label2" /></frame>
	
	- Default values -
	As long as not noted otherwise, the default value for attributes is 
	"" (text),	"0" (numeric), "no" (boolean).
	However, the 'name' attribute is a general exception to this rule. If a
	name for a control is not explicitly given the application will generate 
	an auto-name. The auto-name has the general form "element##" where 
	"element" is the preferred (i.e. in this DTD first listed) tag name and 
	"##" is an one-based index running from 01 to 99 (e.g. "list01", "list02", 
	etc.).
	Furthermore, the 'value' attribute for radio and check buttons supports
	auto-numbering. If the value of a radio button is not given, the 
	application will use the one-based index (e.g. "1", "2", etc.) of the 
	control within its group as its value. If the value of a check button is
	not given, the application will use the fixed integer value "1".
	
	- Layout -
	The controls of the form are usually automatically sized to fit their 
	content. But to improve the alignment of controls, many controls also
	allow an explicit size specification.
	By default, controls are positioned on the form like text, that is 
	starting at the top-left corner going down to the bottom-right corner.
	Line breaks, tab stops, groups and tables can be used to alter this basic
	scheme and to create more complex layouts. 
	Besides, most of the block elements support the 'align' and 'valign' 
	attributes. This alignment will	also apply to children, unless explicitly 
	overriden by a child.
	One should especially care for the form width because the application 
	will not automatically create a new row when the controls do not fit in
	one row (i.e. on the screen of the user).
	If two successive controls in a line have the same class the application
	will shrink the default gap between controls down to a minimum. This
	behaviour is intended to support the visual grouping of similiar controls.
	To simply workaround this, e.g. for alignment reasons, one can enclose 
	every second control into a group element.
	
	- Tab order -
	The form template is processed element by element according to their order 
	in the document. That is, the first element in the document (and its 
	nested child elements) is processed prior to the second element (and its 
	nested child elements) and so forth.
	The corresponding form controls are created in the same order and the tab 
	order of the controls resembles the order of creation. Therefore, the order
	in which the elements appear in the template does not only define the 
	layout of the form but also implies the tab order of the controls.
	Note that this is contrary to HTML where an attribute allows to specify a
	different tab order. However, the 'taborder' attribute of the 'table'
	element can be used to choose between row-by-row or column-by-column tab 
	order.
	
	- Access key / Mnemonic -
	Unlike HTML, the access key or mnemonic for a control cannot be defined by
	an attribute of the element. Instead, the ampersand character "&" can be 
	inserted into the element's 'text'/'title' attribute so that the following
	character will become the access key for that control. Controls will 
	typically underline this character.
	Note that by design not all controls directly support an access key this 
	way (e.g. edit boxes). To enable an access key for those controls one needs
	to place a label (or frame) before the actual control and insert the 
	ampersand into the text of the label. The label then displays the mnemonic 
	to the user and also activates the next control	(i.e. the control that is 
	next in the tab order) when the user presses this key.
	If the ampersand character is to be treated as itself (i.e. simply 
	displayed as "&" instead of marking the next character as the mnemonic) 
	two successive ampersand characters need to be inserted.
	Remember that the ampersand character ("&") must be masked using an entity 
	(e.g. "&amp;").

	- Tooltips / Help -
	Many elements provide a 'tooltip' attribute to specifiy some short 
	description of the control's purpose. This tooltip is displayed when the
	user moves the mouse over the control. Note that the length of this text 
	cannot exceed 80 characters.
	For a more detailed help on a control or the entire form one is encouraged 
	to provide a help file (e.g. in html/pdf format). The URL of this help file
	can then be set as the value of the 'help' attribute of the 'becyform' 
	element to enable the user to access the file from the form using the 
	default web browser.
	
	- Dynamic form update -
	Elements supporting the 'src' attribute can be dynamically updated when 
	another control within the form is changed by the user. In order to do 
	so, the application allows the usage of variables within the URL given
	by 'src'. These variables have the general form "<fieldname>" where 
	"fieldname" is the name of a control as defined by its 'name' attribute.
	When the value of the control referenced by the variable changes, the 
	variable is replaced with the current control value and the application
	requeries the new 'src' URL to update the dependent control(s).
	Examples:
	  "<edit name='imgindex' />...<img src='<imgindex>.png' />"
	  "<list name='language' />...<text src='getlicence.php?lang=<language>' />"
	
	- Buttons -
	The application automatically creates buttons for the default commands 
	required by the form template (e.g. ok, cancel, apply, help, next).
	
	- Form submission -
	Usually only non-empty fields are send to the server when the user submits
	the form. But fields that are part of arrays (indicated by the brackets in 
	their names) are always send so that the array is consistently build by the
	receiving server.
	
	- Server return codes -
	Upon sending the form data to the server using a HTTP POST command, BeCyForm
	expects some response by the server indicating the next action. In general,
	the response is organized into lines and the first line of a response 
	consists of a (decimal) number, the return code. The format and the meaning
	of the following lines may vary depending on the actual return code in the
	first line.
	Here is a list of understood return codes (the character sequence "\n" used
	in the examples represents a new line character (ASCII 0x0A, line feed)):
	  - 0: Ok (with URL)
	    This code signals the successful processing of the submitted form data
	    and tells the application to continue the dialog. This means either
	    quitting the application or downloading and showing the next form.
	    Format:
	      Line | Meaning
	      =====|================================================================
	        1  | Return code 0
	        2  | URL to CGI script to post the next form data to.
	           | This URL can be absolute or relative to the URL of the current
	           | script. One can even pass in only script parameters to query
	           | the current script again with new parameters.
	           | If this line is empty, the application re-uses the URL to the
	           | current CGI script.
	           | For single-form dialogs, this line is ignored and should be
	           | empty.
	        3  | URL to get the next multi-form template from.
	           | If this line is empty, the application will use the URL of the
	           | CGI script within line 2 to download the form (that means the
	           | script is expected to output the form template). If line 2 is
	           | also empty, this indicates the end of a multi-form dialog and
	           | tells the application to quit.
	           | This URL can be absolute or relative to the URL of the current
	           | script (not form!).
	           | For single-form dialogs, this line is ignored and should be
	           | empty.
	        4  | Titel for following message (optional).
	       5-n | Message text to be displayed to the user (optional). This 
	           | message (if given) is displayed before the next action occurs.
	     Examples: 
	       "0\nScript.php?template=2\n\nInfo\nData was successfully processed"
	       "0\n?template=2\n\nInfo\nData was successfully processed"
	       ""  (Note that an empty response is treated as an ok)
	  - 1: Ok (with inline template)
	    This code basically equals code 0. The major difference is that this
	    response directly contains the next form template for a multi-form 
	    dialog instead of specifying an URL.
	    Format:
	      Line | Meaning
	      =====|================================================================
	        1  | Return code 1
	        2  | URL to CGI script to post the next form data to.
	           | This URL can be absolute or relative to the URL of the current
	           | script. One can even pass in only script parameters to query
	           | the current script again with new parameters.
	           | If this line is empty, the application re-uses the URL to the
	           | current CGI script.
	        3  | Reserved. Should be empty.
	        4  | Titel for following message (optional).
	        5  | Message text to be displayed to the user (optional). This 
	           | message (if given) is displayed before the next action occurs.
	           | Pipe characters (|) within this line are converted to line 
	           | breaks to allow multiple lines of text within one line.
	       6-n | The XML-style template for the next multi-form. Providing no
	           | template indicates the end of a multi-form dialog.
	     Examples: 
	       "1\n\n\n\n<becyform>...</becyform>"
	  - 10: Critical error
	    This code signals an unrecoverable error and will cause the application
	    to exit.
	    Format:
	      Line | Meaning
	      =====|===============================================================
	        1  | Return code 10
	       2-3 | Reserved. Should be empty.
	        4  | Titel for following message (optional).
	       5-n | Message text to be displayed to the user (optional). After
	           | displaying the message the application aborts the dialog and
	           | closes. If a message text is not provided the application will
	           | use a generic message so that the user is always informed
	           | about the error prior to the application exit.
	     Examples: 
	       "10"
	       "10\n\n\nCRITICAL ERROR\nPlease contact your administrator!"
	  - 20: Error
	    This code signals a recoverable error. The application will neither
	    close nor download the next form but leave the current form open.
	    Format:
	      Line | Meaning
	      =====|===============================================================
	        1  | Return code 20
	        2  | Reserved. Should be empty.
	        3  | Reserved. Should be empty.
	        4  | Titel for following message (optional).
	       5-n | Message text to be displayed to the user (optional). After
	           | displaying the message the application will not terminate but
	           | allow the user to correct his inputs in the current form so
	           | that he can retry the operation. If a message text is not 
	           | provided the application will use a generic message so that
	           | the user is always informed about the error.
	     Examples: 
	       "20"
	       "20\n\n\nERROR\nPlease check your inputs and try again!"
	  - 30: Console command (with client-side error handling)
	    This code signals a server's request to execute an external program.
	    After execution, BeCyForm will post the console application's
	    exit code, text output (stdout, stderr) and the command ID back to the
	    server for processing. BeCyForm will use the following field names to
	    post the data: "BCF_RETCODE" (exit code), "BCF_OUTPUT" (stdout), 
	    "BCF_ERRMSG" (stderr) and "BCF_CMDID" (command ID).
	    After processing the command results the server sends again one of these
	    return codes to the application.
	    In case of an error (i.e. the application failed to launch the console
	    process) an error message will be displayed to the user and the 
	    application will abort the dialog and terminate (critical error).
	    Format:
	      Line | Meaning
	      =====|===============================================================
	        1  | Return code 30
	        2  | Command line to be executed by the client. Only console 
	           | applications (including batch files) and only those that are
	           | not restricted by the client's administrator can be run.
	        3  | Command ID (optional). This value is a server-defined string
	           | used to associate the returned data with a specific command.
	        4  | Titel for following message (optional).
	       5-n | Message text to be displayed to the user (optional). This
	           | message (if given) is displayed before the command is executed.
	     Examples: 
	       "30\ndiskcopy a: a:\n\nDiskCopy\nNext, the files will be copied. Please be patient."
	  - 31: Console command (with server-side error handling)
	    This return code is basically equal to the code above (code 30) except
	    that in case of an error the application will post the error code to
	    the server using the field "BCF_ERRCODE" instead of "BCF_RETCODE" 
	    allowing the server to decide which action should be taken (e.g. close
	    or continue).
	    BeCyForm reports the following errors:
	      Code | Meaning
	      =====|===============================================================
	      10000| Internal application error. The console-launch utility 
	           | ConSpawn could not be run.
	      11000| File/path not found. The executable the server specified was
	           | not found.
	      11001| Invalid executable type. The executable the server specified
	           | is not a Win32/MS-DOS console application or batch file
	      11002| Execution restricted. The "RestrictRun" policy is in effect
	           | for the user and the specified executable is not allowed.
	      11003| Timeout. The console process did not terminate within 
	           | TimeoutExecute seconds and therefore seems to hang.
	    Format:
	      Line | Meaning
	      =====|===============================================================
	        1  | Return code 31
	       2-n | see console command with client-side error handling (code 30)
	     Examples: 
	       "31\ndiskcopy a: a:\n\nDisk-Copy\nNext, the files will be copied. Please be patient."
	  - 40: File download (with URL)
		The server sends this code to initiate a file download by the client.
		The application will download the file from the given URL and query the
		user for a path to save the file to.
		Finally, the client will send a result code (see below) using the field 
		"BCF_RETCODE" together with the path of the saved file using 
		"BCF_PATHNMAME" (and the optional command identifier within "BCF_CMDID") 
		back to the	server. The expected response by the server is another 
		return code to continue the dialog.
	    Result codes:
	      Code | Meaning
	      =====|===============================================================
	        0  | Ok. The file was successfully downloaded and saved.
	        1  | Cancel. The user canceled the saving process.
	      12000| Error. The file could not be downloaded.
	      13000| Error. The file could not be saved.
	    Format:
	      Line | Meaning
	      =====|===============================================================
	        1  | Return code 40
	        2  | URL to file to be downloaded. This URL can be absolute or 
	           | relative to the URL of the current script.
	           | If this URL identifies a CGI script which outputs the file 
	           | data, the script should use the filename parameter of the HTTP
	           | header field Content-Disposition to provide a name for the 
	           | file to save (e.g. Content-Disposition: attachment; 
	           | filename="Output.pdf").
	        3  | Command ID (optional). This value is a server-defined string
	           | used to associate the returned data with a specific command.
	        4  | Titel for following message (optional).
	       5-n | Message text to be displayed to the user (optional). This
	           | message (if given) is displayed before the file is downloaded.
	     Examples: 
	       "40\nOutput.pdf\n\nInfo\nNext, the generated file will be downloaded. Please be patient."
	  - 41: File download (with inline file)
		Use this code instead of code 40 if the file data to be downloaded is
		attached to the response.
	    Format:
	      Line | Meaning
	      =====|===============================================================
	        1  | Return code 41
	        2  | Name for file to save (e.g. "Output.pdf").
	        3  | Command ID (optional). This value is a server-defined string
	           | used to associate the returned data with a specific command.
	        4  | Titel for following message (optional).
	        5  | Message text to be displayed to the user (optional). This 
	           | message (if given) is displayed before the file download.
	           | Pipe characters (|) within this line are converted to line 
	           | breaks to allow multiple lines of text within one line.
	       6-n | Contents of (binary) file to download. The file data is 
	           | expected to start immediately after the line break terminating
	           | line 5.
	     Examples: 
	       "41\nOutput.pdf\n\nInfo\nNext, the generated file will be downloaded. Please be patient.\n(data)..."
	  - 43: File download and exit (with inline file)
		A server can use this code instead of code 41 when the dialog has been
		finished and the server does not care for the result code. After 
		prompting the user to save the file, the application will quit without
		further communication with the server (regardless whether there was
		an error while downloading or the user canceled the process).
	    Format:
	      Line | Meaning
	      =====|===============================================================
	        1  | Return code 43
	       2-n | see code 41 above
	     Examples: 
	       "43\nOutput.pdf\n\nInfo\nNext, the generated file will be downloaded. Please be patient.\n(data)..."
	  - 48: File download, editing and upload (with URL)
		A server can send this code to request the client to download, edit and
		upload a file back to the server. The file given by the URL will be
		saved locally as a temporary file without asking the user for a path. 
		Finally, the client will send a result code (see below) using the field 
		"BCF_RETCODE" (and the optional command identifier within "BCF_CMDID") 
		back to the	server. Upon success, the field "BCF_FILE" will be used to
		submit the contents of the edited file.	The expected response by the 
		server is another return code to continue the dialog.
	    Result codes:
	      Code | Meaning
	      =====|===============================================================
	        0  | Ok. The file was successfully downloaded and edited.
	        1  | Cancel. The user canceled the editing process.
	      11000| File/path not found. No executable to edit the downloaded file
	           | was found.
	      11002| Execution restricted. The "RestrictRun" policy is in effect
	           | for the user and the required executable to edit the file is 
	           | not allowed.
	      12000| Download failed. The file could not be downloaded.
	      13000| Write error. The temporary file could not be saved.
	      13001| Read error. The temporary file could not be read.
	    Format:
	      Line | Meaning
	      =====|===============================================================
	        1  | Return code 48
	        2  | URL to file to be downloaded. This URL can be absolute or 
	           | relative to the URL of the current script.
	           | If this URL identifies a CGI script which outputs the file 
	           | data, the script must use the filename parameter of the HTTP
	           | header field Content-Disposition to provide a name for the 
	           | file to save (e.g. Content-Disposition: attachment; 
	           | filename="Text.txt"). Especially the file name extension
	           | is required to spawn the correct application to edit the file.
	           | The URL may be preceeded by a command line to control which
	           | application is launched for editing. This command line is
	           | separated from the file URL using the angle bracket ">" 
	           | (e.g. 'notepad "%1">Text.txt' or 'notepad>Text.txt').
	        3  | Command ID (optional). This value is a server-defined string
	           | used to associate the returned data with a specific command.
	        4  | Titel for following message (optional).
	       5-n | Message text to be displayed to the user (optional). This
	           | message (if given) is displayed before the file is downloaded.
	     Examples: 
	       "48\nText.txt\n\nInfo\nThe requested file will now be downloaded for editing."
	  - 49: File download, editing and upload (with inline file)
		This codes is similar to code 48 except that instead of an URL the file
		itself is provided as part of the response.
	    Format:
	      Line | Meaning
	      =====|===============================================================
	        1  | Return code 49
	        2  | File name for the file data. Especially the file name extension
	           | is required to spawn the correct application to edit the file.
	        3  | Command ID (optional). This value is a server-defined string
	           | used to associate the returned data with a specific command.
	        4  | Titel for following message (optional).
	        5  | Message text to be displayed to the user (optional). This 
	           | message (if given) is displayed before the file download.
	           | Pipe characters (|) within this line are converted to line 
	           | breaks to allow multiple lines of text within one line.
	       6-n | Contents of (binary) file to edit. The file data is expected
	           | to start immediately after the line break terminating line 5.
	     Examples: 
	       "49\nAvatar.png\n\nInfo\nThe requested file will now be downloaded for editing.\n...(PNG image data)..."
	Although not recommended, it is possible to use an alternative format for
	the ok responses. The server can directly send a form template as response
	instead of sending a complete code 1 response. Similar, the server can
	directly send a message text instead of sending a complete code 0. If these
	response formats are used, one should carefully check whether the 
	application correctly recognizes the sent text as a form template or text
	message.
	      
=============================================================================-->


<!--============================================================================
	DOCUMENT ROOT
	
	Serves as the entry point for a form and defines basic settings. This 
	element is obligatory.
	
	Attributes:
		version    version of applied document type definition for template; should be the first attribute if specified; default is "1.0"
		title      form title to be displayed in window bar of dialog (e.g. "FormTitle")
		text       alternative (semantical equivalent) for 'title'
		help       URL (absolute or relative to source of form) to help file about form; if given a help button will be displayed in the form to open the resource using the user's default web browser; if the anchor "#auto" (lowercase characters!) is appended to a html file the application will automatically append an anchor (i.e. [index##][tab##]) indicating the current (one-based) multi-form index (if any) and the current (one-based) tab index (if any); if "auto@" (lowercase characters!) is prepended to the URL, the application will insert user authentication data into the URL; but note that the use of "auto@" is a potential security risk because the operating system will likely perform a message broadcast when trying to start the default web browser, thus allowing any running application to view the user's password within the URL (which is clear text)
		index      index (ranging from "1" up) of current form within a multi-form dialog; for multi-form dialogs the available buttons will change to "Next" and "Cancel" and the server will receive the value of the current 'index' attribute in the variable BCF_INDEX along with the other form data when submitting the form
		font-face  name of font to be used for form and its controls; note that the actual font used depends on the installed fonts of the client system; default is user-defined preference (appearance page in the control panel)
		font-size  size of font to be used for form and its controls measured in point (pt); default is user-defined preference (appearance page in the control panel)
		align      horizontal alignment of child controls; valid values: "left" (default), "center", "right"
		valign     vertical alignment of child controls; valid values: "top" (default), "middle", "bottom"
		enctype    identifies the encoding to be applied to the form data prior the posting it to the server; the default "url" (application/x-www-form-urlencoded) results in a quite compact data stream while "multipart" (multipart/form-data) produces much more overhead; note that the later is always used by the application when using a file element for upload within the form
		enter-nav  boolean value whether the user may use the Enter/Return key to move the focus to next control; this provides an additional way to navigate among the form controls besides the Tab key
		no-apply   boolean value whether the apply button should be hidden; only valid for single-form dialogs
		
	Example:
		<becyform version="1.0" title="FormTitle" help="www.becyhome.de/index.htm" font-face="MS Sans Serif" font-size="8">...</becyform>
=============================================================================-->
<!ELEMENT becyform (((hidden)*, tabset, (hidden)*) | (#PCDATA | br | ts | table | label | edit | text | textarea | frame | fieldset | group | check | radio | list | select | img | file | hidden)*)?>
<!ATTLIST becyform
	version        CDATA     #IMPLIED
	title          CDATA     #IMPLIED
	text           CDATA     #IMPLIED
	help           CDATA     #IMPLIED
	index          CDATA     #IMPLIED
	font-face      CDATA     #IMPLIED
	font-size      CDATA     #IMPLIED
	align          (left|center|right)           #IMPLIED
	valign         (top|middle|bottom)           #IMPLIED
	enctype        (url|multipart)               #IMPLIED
	enter-nav      (yes|no|true|false|1|0)       #IMPLIED
	no-apply       (yes|no|true|false|1|0)       #IMPLIED
>
	
	
<!--============================================================================
	PROPERTY SHEET

	Creates a property sheet, that is a control which offers multiple pages 
	with different controls. Only one page at a time is visible to the user
	which allows a compact presentation of many controls.
	
	Attributes:
		align      horizontal alignment of child controls; valid values: "left" (default), "center", "right"
		valign     vertical alignment of child controls; valid values: "top" (default), "middle", "bottom"
	
	Example:
		<tabset>...</tabset>
=============================================================================-->
<!ELEMENT tabset (tab | hidden)*>
<!ATTLIST tabset
	align          (left|center|right)           #IMPLIED
	valign         (top|middle|bottom)           #IMPLIED
>	


<!--============================================================================
	PROPERTY SHEET PAGE

	Creates a single tab for a property sheet.
	
	Attributes:
		title      property sheet page title to be displayed in tab
		text       alternative (semantical equivalent) for 'title'
		align      horizontal alignment of child controls; valid values: "left" (default), "center", "right"
		valign     vertical alignment of child controls; valid values: "top" (default), "middle", "bottom"
	
	Example:
		<tab title="Tab1">...</tab>
=============================================================================-->
<!ELEMENT tab (#PCDATA | br | ts | table | label | edit | text | textarea | frame | fieldset | group | check | radio | list | select | img | file | hidden)*>
<!ATTLIST tab
	title          CDATA     #IMPLIED
	text           CDATA     #IMPLIED
	align          (left|center|right)           #IMPLIED
	valign         (top|middle|bottom)           #IMPLIED
>

	
<!--============================================================================
	FRAMELESS FIELDSET

	Does not create any visible control but groups its nested child controls. 
	This grouping allows more control on the layout of the form.
	
	Attributes:
		align      horizontal alignment of child controls; valid values: "left" (default), "center", "right"
		valign     vertical alignment of child controls; valid values: "top" (default), "middle", "bottom"
	
	Example:
		<group>...</group>
=============================================================================-->
<!ELEMENT group (#PCDATA | br | ts | table | label | edit | text | textarea | frame | fieldset | group | check | radio | list | select | img | file | hidden)*>
<!ATTLIST group
	align          (left|center|right)           #IMPLIED
	valign         (top|middle|bottom)           #IMPLIED
>

	
<!--============================================================================
	FIELDSET WITH FRAME

	Creates a frame, that is a control which cannot be activated by the user 
	but simply displays some descriptive text (for the following controls)
	and draws a box around its nested child controls.
	
	Attributes:
		title      frame title to be displayed on border; may contain (masked) ampersand to define an access key for following control
		text       alternative (semantical equivalent) for 'title'
		align      horizontal alignment of child controls; valid values: "left" (default), "center", "right"
		valign     vertical alignment of child controls; valid values: "top" (default), "middle", "bottom"
	
	Example:
		<frame title="Group of controls">...</frame>
=============================================================================-->
<!ELEMENT frame (#PCDATA | br | ts | table | label | edit | text | textarea | frame | fieldset | group | check | radio | list | select | img | file | hidden)*>
<!ATTLIST frame
	title          CDATA     #IMPLIED
	text           CDATA     #IMPLIED
	align          (left|center|right)           #IMPLIED
	valign         (top|middle|bottom)           #IMPLIED
>
<!ELEMENT fieldset (#PCDATA | br | ts | table | label | edit | text | textarea | frame | fieldset | group | check | radio | list | select | img | file | hidden)*>
<!ATTLIST fieldset
	title          CDATA     #IMPLIED
	text           CDATA     #IMPLIED
	align          (left|center|right)           #IMPLIED
	valign         (top|middle|bottom)           #IMPLIED
>

	
<!--============================================================================
	TABLE

	Creates an invisible table to simplify the layout process.
	
	Attributes:
		align      horizontal alignment of child controls; valid values: "left" (default), "center", "right"
		valign     vertical alignment of child controls; valid values: "top" (default), "middle", "bottom"
		stretch    (boolean) value whether smaller rows/columns should be stretched so that all rows/columns have the same height/width
		taborder   direction in which the user navigates among table cells; for the default "row", the focus moves to the next column within the current row before moving down to the next row; for "col", the focus moves down to the next row within the current column before moving to the next column
	
	Example:
		<table align="center" valign="middle" stretch="rows">...</table>
=============================================================================-->
<!ELEMENT table (tr)*>
<!ATTLIST table
	align          (left|center|right)           #IMPLIED
	valign         (top|middle|bottom)           #IMPLIED
	stretch        (none|rows|cols|both|all|yes|no|true|false|1|0|on|off)  #IMPLIED
	taborder       (row|col)                     #IMPLIED
>

	
<!--============================================================================
	TABLE ROW

	Creates a row within a table.
	
	Attributes:
		align      horizontal alignment of child controls; valid values: "left" (default), "center", "right"
		valign     vertical alignment of child controls; valid values: "top" (default), "middle", "bottom"
	
	Example:
		<tr align="center" valign="middle">...</tr>
=============================================================================-->
<!ELEMENT tr (td)*>
<!ATTLIST tr
	align          (left|center|right)           #IMPLIED
	valign         (top|middle|bottom)           #IMPLIED
>

	
<!--============================================================================
	TABLE CELL

	Creates a (data) cell within a row of a table.
	
	Attributes:
		align      horizontal alignment of child controls; valid values: "left" (default), "center", "right"
		valign     vertical alignment of child controls; valid values: "top" (default), "middle", "bottom"
	
	Example:
		<td align="center" valign="middle">...</td>
=============================================================================-->
<!ELEMENT td (br | ts | table | label | edit | text | textarea | frame | fieldset | group | check | radio | list | select | img | file | hidden)*>
<!ATTLIST td
	align          (left|center|right)           #IMPLIED
	valign         (top|middle|bottom)           #IMPLIED
>
	

<!--============================================================================
	STATIC TEXT

	Creates a label, that is a control which cannot be activated by the user 
	but simply displays some descriptive text (for the following control).
	
	Attributes:
		text       static text to be displayed (e.g. as a description for the following control); may contain (masked) ampersand to define an access key for following control
		cols       width of the control itself in characters; the application supports a special notation, that is prefixing the number with a leading zero (e.g. "02"), to create a control that has the same width as a comparable multi-line box by adding space for a vertical scroll bar (this might be useful for optical tuning)
		size       alternative (semantical equivalent) for 'cols'
	
	Example:
		<label text="Please enter &amp;something:" />
=============================================================================-->
<!ELEMENT label (#PCDATA | br | ts)*>
<!ATTLIST label
	text           CDATA     #IMPLIED
	cols           CDATA     #IMPLIED
	size           CDATA     #IMPLIED
>
	

<!--============================================================================
	SINGLE-LINE EDIT BOX

	Creates an single-line edit box, that is a control in which the user can 
	enter short text, numbers, passwords, etc.
	Note that for edit type 'number', the application performs an automatic
	conversion of the US-style decimal point (".") to the locale-specific decimal 
	point (e.g. ",") expected by the user and vice versa. This conversion takes 
	place when an initial value for the edit is given in the form template and 
	again when the number is sent back to the server along with the other form 
	data.
	Edit type 'number-ud' attaches an up-down- or spin-button to the edit box, 
	so that the user can use the mouse to change the value. But due to different
	implementations of the operation systems, the value of such an edit box might
	be limited to only 16 bit (i.e. -32767 to 32767).
	
	Attributes:
		name       unique identifier within the form which will be used to return the control data to the server
		text       initial control data (presetting, default)
		value      alternative (semantical equivalent) for 'text'
		src        URL (absolute or relative to source of form; may contain variables to use dynamic form update) to initial control data; if given and accessable, this resource overrides the value of the 'text' attribute (that means one can still supply 'text' to display an error to the user)
		tooltip    quick info on this control
		cols       width of the control itself in characters; the application supports a special notation, that is prefixing the number with a leading zero (e.g. "02"), to create a control that has the same width as a comparable multi-line box by adding space for a vertical scroll bar (this might be useful for optical tuning)
		size       alternative (semantical equivalent) for 'cols'
		maxlength  maximum number of allowed characters the user may type; max limit is ~64.000 (default); this value will also be used for the width of the control as long as the "size" attribute is not given
		required   (boolean) value whether the user should enter some data into this field; if given leaving this field empty will cause the application to prevent the user from submitting the form until he entered some data; note that the value of this attribute can either be a boolean value or the message to be displayed to the user
		readonly   boolean value whether the user can change the control data or not
		pwdchar    single character to be displayed instead of the actual text for password queries; the empty string ("") will also enable password mode using the default password character
		type       classification of allowed characters the user can enter; valid values are: "text" (default), "password" (same as "text" but enables password mode), "ascii", "email", "number", "number-ud" (similar to "number" but causes an additional up-down-control to be created for changing the value)
		range      sub-classification of allowed characters (for "text", "ascii", "password") / valid value range (for "number"); for "number" range has the form "min,max" where "min" and "max" also specify whether floating-point numbers may be entered (i.e. when "min"/"max" are given as floats); for "text"/"ascii"/"password" range has the form "CharList" to specify a positive filter (valid characters) and "!CharList" to specify a negative filter (invalid characters)
		
	Example:
		<edit name="Login" type="text" range="[a-z][A-Z]_-" text="NewUser" required="1" tooltip="Your user name" size="10" maxlength="20" />
		<edit name="Password" type="ascii" tooltip="Your account password (case-sensitive)" pwdchar="" />
		<edit name="Amount" type="number" range="0,100.0" required="Please enter the amount!"/>
=============================================================================-->
<!ELEMENT edit (#PCDATA)>
<!ATTLIST edit
	name           ID        #IMPLIED
	text           CDATA     #IMPLIED
	value          CDATA     #IMPLIED
	tooltip        CDATA     #IMPLIED
	cols           CDATA     #IMPLIED
	size           CDATA     #IMPLIED
	maxlength      CDATA     #IMPLIED
	pwdchar        CDATA     #IMPLIED
	required       CDATA     #IMPLIED
	readonly       (yes|no|true|false|1|0)       #IMPLIED
	type           (text|password|ascii|number|number-ud)            #IMPLIED
>
	

<!--============================================================================
	MULTI-LINE EDIT BOX

	Creates an multi-line edit box, that is a control in which the user can 
	enter text passages like messages, comments etc.
	
	Attributes:
		name       unique identifier within the form which will be used to return the control data to the server
		text       initial control data (presetting, default)
		value      alternative (semantical equivalent) for 'text'
		src        URL (absolute or relative to source of form; may contain variables to use dynamic form update) to initial control data; if given and accessable, this resource overrides the value of the 'text' attribute (that means one can still supply 'text' to display an error to the user)
		tooltip    quick info on this control
		cols       width of the control itself in characters
		rows       height of the control itself in lines
		maxlength  maximum number of allowed characters the user may type; max limit is ~64.000 (default)
		readonly   boolean value whether the user can change the control data or not
	
	Example:
		<text name="License" src="Licence.txt" text="Oops..." tooltip="Read this carefully" cols="20" rows="20" readonly="yes" />
=============================================================================-->
<!ELEMENT text (#PCDATA | br | ts)*>
<!ATTLIST text
	name           ID        #IMPLIED
	text           CDATA     #IMPLIED
	value          CDATA     #IMPLIED
	src            CDATA     #IMPLIED
	tooltip        CDATA     #IMPLIED
	cols           CDATA     #IMPLIED
	rows           CDATA     #IMPLIED
	maxlength      CDATA     #IMPLIED
	readonly       (yes|no|true|false|1|0)       #IMPLIED
>
<!ELEMENT textarea (#PCDATA | br | ts)*>
<!ATTLIST textarea
	name           ID        #IMPLIED
	text           CDATA     #IMPLIED
	value          CDATA     #IMPLIED
	src            CDATA     #IMPLIED
	tooltip        CDATA     #IMPLIED
	cols           CDATA     #IMPLIED
	rows           CDATA     #IMPLIED
	maxlength      CDATA     #IMPLIED
	readonly       (yes|no|true|false|1|0)       #IMPLIED
>
	

<!--============================================================================
	RADIO BUTTON

	Creates a radio button, that is a control with some text and a little box 
	next to the text which can either be checked or unchecked. Radio buttons 
	are typically used to display mutually exclusive options by grouping them 
	together so that only one button at a time can be checked (a group of 
	buttons is created when successive buttons have the same name).
	
	Attributes:
		name       unique identifier within the form which will be used to return the control data to the server; however, the identifier can be re-used for successive radio buttons to build a button group from which only one button can be checked (at a time)
		text       name/description of option to be displayed to user; may contain (masked) ampersand to define an access key for this button
		value      text to be returned to the server when this button is checked; defaults to one-based index of control within its group
		tooltip    quick info on this control
		cols       width of the control itself in characters; the application supports a special notation, that is prefixing the number with a leading zero (e.g. "02"), to create a control that has the same width as a comparable multi-line box by adding space for a vertical scroll bar (this might be useful for optical tuning)
		size       alternative (semantical equivalent) for 'cols'
		checked    boolean value whether the button is initially checked or not
		selected   alternative (semantical equivalent) for 'checked'
		required   (boolean) value whether the user should select one of the options; this attribute applies to the whole button group but can only be set for the first button in the group; if given, a missing selection will cause the application to prevent the user from submitting the form until he selected an option; note that the value of this attribute can either be a boolean value or the message to be displayed to the user
	
	Example:
		<radio name="Gender" text="I'm a man" value="male" tooltip="Are you a man ..." required="1" />
		<radio name="Gender" text="I'm a woman" value="female" tooltip="... or a woman?" />
=============================================================================-->
<!ELEMENT radio (#PCDATA)>
<!ATTLIST radio
	name           ID        #IMPLIED
	text           CDATA     #IMPLIED
	value          CDATA     #IMPLIED
	tooltip        CDATA     #IMPLIED
	cols           CDATA     #IMPLIED
	size           CDATA     #IMPLIED
	checked        (yes|no|true|false|1|0)       #IMPLIED
	selected       (yes|no|true|false|1|0)       #IMPLIED
	required       CDATA     #IMPLIED
>
	

<!--============================================================================
	CHECK BOX

	Creates a check box, that is a control with some text and a little box next
	to the text which can either be checked or unchecked.
	
	Attributes:
		name       unique identifier within the form which will be used to return the control data to the server; however, the identifier can be re-used for successive check boxes to build a button group
		text       name/description of option to be displayed to user; may contain (masked) ampersand to define an access key for this button
		value      text to be returned to the server when this button is checked; defaults to one-based index of control within its group
		tooltip    quick info on this control
		cols       width of the control itself in characters; the application supports a special notation, that is prefixing the number with a leading zero (e.g. "02"), to create a control that has the same width as a comparable multi-line box by adding space for a vertical scroll bar (this might be useful for optical tuning)
		size       alternative (semantical equivalent) for 'cols'
		checked    boolean value whether the button is initially checked or not
		selected   alternative (semantical equivalent) for 'checked'
	
	Example:
		<check name="Pets" text="I like dogs" value="dogs" tooltip="Click here, if you like them" />
		<check name="Pets" text="I like cats" value="cats" tooltip="Click here, if you like them" />
=============================================================================-->
<!ELEMENT check (#PCDATA)>
<!ATTLIST check
	name           ID        #IMPLIED
	text           CDATA     #IMPLIED
	value          CDATA     #IMPLIED
	tooltip        CDATA     #IMPLIED
	cols           CDATA     #IMPLIED
	size           CDATA     #IMPLIED
	checked        (yes|no|true|false|1|0)       #IMPLIED
	selected       (yes|no|true|false|1|0)       #IMPLIED
>
	

<!--============================================================================
	LIST/COMBO BOX
	
	Creates a list/combo box, that is a control from which the user can select
	one or more predefined values. Note that combo boxes only support single-
	selection.
	When using a separate file for filling the list with items (using the 'src'
	attribute), the file is expected to have the following format: Each line 
	represents a single list item, empty lines are ignored. A space character 
	(ASCII code 0x20) at the beginning of a line is cut off and results in the 
	item being initially selected. The last pipe character ("|") in a line (if 
	any) separates the item text (which is displayed to the user) from the item
	value (which is send to the	server).
	
	Attributes:
		name       unique identifier within the form which will be used to return the control data to the server
		tooltip    quick info on this control
		src        URL (absolute or relative to source of form; may contain variables to use dynamic form update) to items; if given and accessable, this resource overrides the items given within the form template
		rows       height of list in items (lines); values greater than "1" produces a list box, all other values produce a combo box
		cols       width of the control itself in characters; for values below "1" (default) the application will calculate the width to fit the longest list item text; if 'src' uses dynamic form update, this value should be explicitly given
		size       alternative (semantical equivalent) for 'rows'
		required   (boolean) value whether the user should select an element from this field; if given a missing selection will cause the application to prevent the user from submitting the form until he selected an element; note that the value of this attribute can either be a boolean value or the message to be displayed to the user
		multiple   (boolean) value indicating whether the list allows selection of more than one item at a time (list box only); there are two kinds of multiple selection modes available (1-extended, 2-simple) which differ in the way the user can change an item's selection state
		edit       boolean value to enable the edit box of a combo box; this way, a user can choose an item from the list as usual but additionally he can enter some arbitrary text as well
	
	Example:
		<list name="Favorites" tooltip="Which one do you like most?" size="5" multiple="yes">...</list>
=============================================================================-->
<!ELEMENT list (item | option)*>
<!ATTLIST list
	name           ID        #IMPLIED
	tooltip        CDATA     #IMPLIED
	src            CDATA     #IMPLIED
	rows           CDATA     #IMPLIED
	cols           CDATA     #IMPLIED
	size           CDATA     #IMPLIED
	required       CDATA     #IMPLIED
	multiple       (yes|no|true|false|2|1|0|simple|extended)         #IMPLIED
	edit           (yes|no|true|false|1|0)       #IMPLIED
>
<!ELEMENT select (item | option)*>
<!ATTLIST select
	name           ID        #IMPLIED
	tooltip        CDATA     #IMPLIED
	src            CDATA     #IMPLIED
	rows           CDATA     #IMPLIED
	cols           CDATA     #IMPLIED
	size           CDATA     #IMPLIED
	required       CDATA     #IMPLIED
	multiple       (yes|no|true|false|2|1|0|simple|extended)         #IMPLIED
	edit           (yes|no|true|false|1|0)       #IMPLIED
>
	

<!--============================================================================
	LIST/COMBO BOX ITEM

	Specifies one item for a list/combo box. Items appear in the same order as
	in the form template and are not sorted.
		
	Attributes:
		text       name/description of item to be displayed to user
		value      alternative text to be returned to the server when this item is selected instead of 'text'
		selected   boolean value indicating whether the item is initially selected (presetting, default)
	
	Example:
		<item text="Chocolate" value="choco" selected="yes" />
		<item text="Vanilla" value="vanilla" selected="no" />
=============================================================================-->
<!ELEMENT item (#PCDATA | ts)*>
<!ATTLIST item
	text           CDATA     #IMPLIED
	value          CDATA     #IMPLIED
	selected       (yes|no|true|false|1|0)       #IMPLIED
>
<!ELEMENT option (#PCDATA | ts)*>
<!ATTLIST option
	text           CDATA     #IMPLIED
	value          CDATA     #IMPLIED
	selected       (yes|no|true|false|1|0)       #IMPLIED
>
	

<!--============================================================================
	IMAGE

	Specifies an image (icon/bitmap) to be displayed in the form.
		
	Attributes:
		src        icon type or URL (absolute or relative to source of form) to image file (may contain variables to use dynamic form update); supported icon values: "info"/"information", "question", "exclamation"/"warning", "error"; supported image types: bitmap, png
		width      width of the image in pixel; by default the width will be set to the actual width of the image; the width must be given if the 'src' attribute uses dynamic form update
		height     height of the image in pixel; by default the width will be set to the actual height of the image; the height must be given if the 'src' attribute uses dynamic form update
		cols       width of the control itself in characters; this value will only be used if 'width' is not given; it is indended to improve optical alignment
		rows       height of the control itself in lines; this value will only be used if 'height' is not given; it is indended to improve optical alignment
		border     boolean value whether the image should be enclosed by a border
		stretch    boolean value whether the image should be (proportionally) stretched/shrinked to fit into the control; only valid for non-icon images
		
	Example:
		<img src="information" />
		<img src="info.png" border="1" width="100" height="50" stretch="1" />
=============================================================================-->
<!ELEMENT img EMPTY>
<!ATTLIST img
	scr            CDATA     #IMPLIED
	width          CDATA     #IMPLIED
	height         CDATA     #IMPLIED
	cols           CDATA     #IMPLIED
	rows           CDATA     #IMPLIED
	border         (yes|no|true|false|1|0)       #IMPLIED
	stretch        (yes|no|true|false|1|0)       #IMPLIED
>
	

<!--============================================================================
	FILE UPLOAD

	Creates an input field in which the use can enter a path name of a local file 
	to be posted to the server.
		
	Attributes:
		name       unique identifier within the form which will be used to return the control data to the server
		tooltip    quick info on this control
		value      initial path name (presetting, default)
		text       alternative (semantical equivalent) for 'value'
		size       width of the control itself in characters
		maxlength  maximum size of file in bytes; the default value "0" disables the size limit
		filter     specifies a file extension based filter for the "Browse" dialog box; the filter has the following form: "Description1|*.ext11;*.ext12;...;*.ext1n|Description2|*.ext21;*.ext22;...|..."; the filter's only purpose is to assist the user in selecting a file of the correct type, it is not intended as a means of file type restriction because the user still may select a file of any type; the default filter is "", allowing the user to select any file
		required   (boolean) value whether the user should enter a file; if given a missing file selection will cause the application to prevent the user from submitting the form until he selected an element; note that the value of this attribute can either be a boolean value or the message to be displayed to the user
	
	Example:
		<file name="image" size="50" maxlength="10240" tooltip="The path to your image to upload" filter="Images|*.gif;*.jpg;*.png" />
=============================================================================-->
<!ELEMENT file (#PCDATA)>
<!ATTLIST file
	name           ID        #IMPLIED
	tooltip        CDATA     #IMPLIED
	text           CDATA     #IMPLIED
	value          CDATA     #IMPLIED
	size           CDATA     #IMPLIED
	maxlength      CDATA     #IMPLIED
	filter         CDATA     #IMPLIED
>
	

<!--============================================================================
	HIDDEN

	Creates an invisible data element for internal use by the server script.
		
	Attributes:
		name       unique identifier within the form which will be used to return the control data to the server
		value      data to be sent to the server; the user can neither see nor change this data
		text       alternative (semantical equivalent) for 'value'
	
	Example:
		<hidden name="session" value="0345" />
=============================================================================-->
<!ELEMENT hidden (#PCDATA)>
<!ATTLIST hidden
	name           ID        #IMPLIED
	value          CDATA     #IMPLIED
	text           CDATA     #IMPLIED
>


<!--============================================================================
	LINE BREAK
	
	In the context of text (PCDATA within inline elements), this element causes
	a usual line break and is semantically equal to "&x0D;&x0A;".
	In the context of control creation (within block elements), this element
	causes the application to create all following controls in a new row (i.e.
	below the preceeding controls).
	
	Attributes:
		(none)
	
	Example:
		<br/>
=============================================================================-->
<!ELEMENT br EMPTY>
	

<!--============================================================================
	HORIZONTAL TAB
	
	In the context of text (PCDATA within inline elements), this element causes
	a usual tab stop and is semantically equal to "&x09;".
	In the context of control creation (within block elements), this element
	causes the application to leave some gap between the current and the next
	control.
	
	Attributes:
		(none)
	
	Example:
		<ts/>
=============================================================================-->
<!ELEMENT ts EMPTY>

