In the XFDL language, options define the item characteristics. Options themselves may contain any number of array elements, which further define the characteristics. Options can contain simple character data, computes or computations, or array elements.
For simple character data content:
<optionTag>character data content</optionTag>
For computed options:
<optionTag compute="expression">character data content</optionTag>
For array options:
<optionTag>
<!-- suboption elements -->
</optionTag>
An option defines a characteristic given to a form, a page, or an item. For example, the bgcolor option set at the form or page global level defines the background color of the pages of the form itself whereas a bgcolor option set at the item level defines the background color for the containing item. Some form and page global options define defaults for item-level options. For example, if an item has no fontinfo option, then the fontinfo in the page globals are used, and if the page globals contain no fontinfo option, then the fontinfo in the form globals (and the form global fontinfo has implied defaults if it is not specified).
The definition of an option consists of content between start and end tags. The element tag defines the type of option. This type must be one of the option types defined in this specification, or a user-defined option that follows the rules in the "custom option" description in this specification.
<value>This is the value</value>
If the character content must be computed, then the computational expression appears in the start tag of the option in an attribute named compute. If the XFDL computation system has been applied to the form, then the option also contains simple character data for the current computed value of the expression. For example:
<value compute="price1Field.value + price2Field.value * '0.07'">205.68
</value>
It is typical to have a form run its computes on a client machine, then have server modules simply read the current values, ignoring the content of the compute attributes. In essence, an application can ignore the compute attributes unless it must change element values that are referenced by computed options. See section XFDL compute system for details on how the compute expression is represented.
<itemlocation>
<under>nameField</under>
<after>addressField</after>
</itemlocation>
Each array element may also contain an array. This recursive definition permits arbitrary depth for XFDL arrays.
XFDL assigns names to these array elements so that they are easier to reference.An option set at a lower level in the form hierarchy overrides a similar option set at a higher level. It overrides it for only the level it is in and any that come under it in the hierarchy. For example, the fontinfo option in the following example would override a global fontinfo setting for the page it is in, and also for any items in that page.
<page sid="Page1">
<global="global">
<fontinfo>
<fontname>Helvetica</fontname>
<size>12</size>
<effect>plain</effect>
</fontinfo>
</global>
Form global options are optional and must be defined in a <global> element in a <globalpage> element after the XFDL start tag and before the first <page> in a form. Page global options are optional and must be defined in a <global> element after the <page> start tag and before the first item in a page. To determine whether an option is a valid form global or page global option, see section Form globals.
XFDL defines a set of data types that describe type of content allowed in an option. Each option description in this specification uses one or more of the following data type designators:
The syntax of an RGB triplet is:
<bgcolor>Red, Green, Blue</bgcolor>
Where red, green, and blue are values from 0 to 255.
The syntax for a hexadecimal RGB value is:
<bgcolor>#RRGGBB</bgcolor>
Where RR, GG, and BB are the hexadecimal values for the red, green, and blue settings.