Custom Forms

Overview

Custom forms can be created using SameGoal's XML dialect. In a single XML file, a form author can specify:

This single XML file is then used by the SameGoal rendering engine to:

Key benefits include:

XML Dialect Specification

Custom forms are created using a proprietary SameGoal XML dialect, described in the SameGoal XML schema.


Main Elements

Main elements (form, section, subsection) are used to create the main structure of each form.

form

Definition: A block-level element. First node of xml form.

Usage: All forms must be enclosed in a form element.

Attributes:

section

Definition: A block-level element. Child of a form element.

Usage: A form is broken into one or more sections. A typical form will have one header section, one footer section, and N body sections (denoted with the "part" attribute). Header and footer sections will not be visible onscreen; only visible when the form is printed. Each body section will generate as a separate tab in the user interface when the form generates. A form with a cover page and four sections would likely use five body sections.

Attributes:

subsection

Definition: A block-level element. Child of a section element.

Usage: A section is broken into one or more subsections. While you cannot currently see subsections directly in the user interface, future work may expose functionality to the user to view and complete each subsection at a time. Additionally, subsections are used during print rendering to group nested information together, so it is helpful to group short amounts of related information together in each subsection.

Attributes:


Input Elements

Imput elements (date, text_input, rte, options_list, option) are the only elements which can be used to capture information from the user.

date

Definition: A inline element for a user to enter a date. Generates corresponding calendar in user interface for fast entry.

Usage: Use to capture a date field.

Attributes:

text_input

Definition: A inline element for a user to enter a small amount of text (single-line/several words). Generates corresponding organization bank, user bank, and autocomplete user interface.

Usage: Use to capture a field which should be several words/single-line. Does not allow rich text editing.

Attributes:

rte

Definition: A block-level element for a user to enter unlimited text. Generates corresponding organization bank and user bank user interface.

Usage: Use to capture a field which may require multiple lines of text. Allows for rich text editing within the field. Amount of input in field is unlimited.

Attributes:

options_list

Definition: A block-level element for a user to enter checkbox, radio or select values.

Usage: Use to create a checkbox, radio or select field (set by "option_type").

Attributes:

option

Definition: An element used to describe each option in an options_list.

Usage: Used once for each option in an options_list (eg one radio button, or one checkbox, in a list).

Attributes:


Text Elements

Text elements (b, i, u, sup) format nested text.

b

Definition: An inline element used to bold nested text.

Usage: Use to bold text. Same effect as HTML b tag.

Attributes: None.

i

Definition: An inline element used to italicize nested text.

Usage: Use to bold text. Same effect as HTML i tag.

Attributes: None.

u

Definition: An inline element used to underline nested text.

Usage: Use to underline text. Same effect as HTML u tag.

Attributes: None.

sup

Definition: An inline element used to superscript nested text.

Usage: Use to superscript text. Same effect as HTML sup tag.

Attributes: None.


Misc Elements

Miscellaneous elements (br, hr, page_number, img, items_list, item) are used for line breaks, horizontal rules, automatic page numbering, lists, and inlining images.

br

Definition: An inline element used to line break.

Usage: Use to line break. Same effect as HTML br tag. If used after an inline element, next element will be on next line. If used after block-level element, next element will be after a one-line skip.

Attributes: None.

hr

Definition: A block-level element used to provide a horizontal rule.

Usage: Use as a horizontal rule. Same effect as HTML hr tag.

Attributes: None.

page_number

Definition: An inline element used to provide automatic page numbering.

Usage: Use in a header or footer section to add automatic page numbering to your printed document.

Attributes: None.

img

Definition: An inline element used to inline an image into the form.

Usage: Use to inline an image from any url into the form.

Attributes:

items_list

Definition: A block-level element used for static lists of items.

Usage: Use for bulleted, numbered, etc. lists of static information.

item

Definition: A block-level element used for each list item.

Usage: Used once for each item in an items_list (eg each bullet point).

Attributes: None.


Layout Elements

Layout elements (container, table, tr, td) are used to assist with layout of the page.

container

Definition: A block-level (by default) element which encloses information.

Usage: Often used as a formatted container of information (eg to enclose text for a heading that should be bigger than other parts of the form, with a background color). Good for supplying backgrounds and font face/color/size changes to nested text. Also, can be used to enclose repeated information.

Attributes:

table

Definition: A block-level element. Table. Similar to HTML table tag.

Usage: Use sparingly, when table is needed in form or for advanced page layout.

Attributes:

tr

Definition: Table row. Child of table element. Similar to HTML tr tag.

Usage: Each table requires at least one table row.

Attributes:

td

Definition: Table cell. Child of table row element. Similar to HTML td tag.

Usage: Each table row requires at least one table cell.

Attributes:


Copy Elements

Copy elements (copy, copy_path) are used to facilitate automatic copying from other forms.

copy

Definition: Block-level copy element. If "text" attribute is set, displays as a button. If not, copy element not visible.

Usage: Use "text" attribute when creating a button to "Update" information in a form which a user should click as needed. When wishing to auto-copy information at form creation time, do not supply the "text" attribute and instead set "auto_copy" attribute to "true".

In many cases, it is helpful to both auto-copy and also give the option to click to update. When this is true, use two copy elements, each with the same copy_paths but differing copy element attributes.

Attributes:

copy_path

Definition: Copy path element.

Usage: Represents one copy path to execute in a copy element.

Attributes:


Attribute Enums