# HG changeset patch # User paulb # Date 1134337544 0 # Node ID fa635ef1e78bffab76b4eed76ce4c1706cff6d82 # Parent b1e5451b3ad84736105da9e054dddb8c6cb23296 [project @ 2005-12-11 21:45:44 by paulb] Added some notes on dynamic multiple-choice value sources. diff -r b1e5451b3ad8 -r fa635ef1e78b docs/reference.html --- a/docs/reference.html Sun Dec 11 21:45:19 2005 +0000 +++ b/docs/reference.html Sun Dec 11 21:45:44 2005 +0000 @@ -52,10 +52,10 @@ a list of elements, each having an attribute with a distinct value; such information is added in the initialisation of the document before it is presented, since it is not part of the -"essential" information in the document.

Example:

<select template:multiple-choice-field="base-system,value" name="...">
...
</select>

Example:

<select template:multiple-choice-field="-,question-type" name="...">
...
</select>

See below for an example combining this attribute with the template:multiple-choice-value attribute.

Syntax:

element-name|-,attribute-name[,new]

Where the special value - +"essential" information in the document.

Example:

<select template:multiple-choice-field="base-system,value" name="...">
...
</select>

Example:

<select template:multiple-choice-field="-,question-type" name="...">
...
</select>

See below for an example combining this attribute with the template:multiple-choice-value attribute.

Syntax:

element-name|-,attribute-name[,new|,new,dynamic|,,dynamic]

Where the special value - is given as the element name, the context element is chosen as the element in the XML document being presented whose attribute is -involved. Where the optional parameter new is given, the attribute is assumed not to already exist on the element.

Related attributes:

Implementing attributes:

template:multiple-choice-value

This +involved. Where the optional parameter new is given, the attribute is assumed not to already exist on the element. Where the optional parameter dynamic is given, the source of the multiple-choice values is considered to be found dynamically rather than from another document.

Related attributes:

Implementing attributes:

template:multiple-choice-value

This attribute associates the template element on which it is used with an element in the XML document being presented whose purpose is to hold one of a list of selectable values (as described above).

Example:

<select template:multiple-choice-field="base-system,value" name="...">
<option template:multiple-choice-value="base-system-enum,value,selected" value="..."/>
</select>

This presents the following document fragment:

<base-system value="c">
<base-system-enum value="a"/>
<base-system-enum value="b"/>
<base-system-enum value="c"/>
</base-system>

The output from the combination of the above would be as follows:

<select name="path-to-base-system">
<option value="a">a</option>
<option value="b">b</option>
<option value="c" selected="selected">c</option>
</select>

Values and Labels

Labels different from the actual values employed can be specified using an extra parameter in the annotation:

<select template:multiple-choice-field="base-system,value" name="...">
<option template:multiple-choice-value="base-system-enum,value,selected,text()" value="..."/>
</select>

This @@ -68,7 +68,7 @@ elements is expanded before presentation to include elements whose values have not been selected. Consequently, the selected elements are marked in a particular way to distinguish them from the non-selected -elements.

Example:

<select template:multiple-choice-list-field="question-types,question-type-enum,question-type" name="..." multiple="multiple">
...
</select>

See below for an example combining this attribute with the template:multiple-choice-list-value attribute.

Syntax:

element-name|-,list-element-name,list-attribute-name

Here, element-name is the element in the document being presented which contains the selected value elements; if the special value - is given then the context element is the element containing the selected value elements. The list-element-name and list-attribute-name indicate the details of the elements providing the list of selectable values.

Related attributes:

Implementing attributes:

template:multiple-choice-list-value

This attribute is similar to template:multiple-choice-value +elements.

Example:

<select template:multiple-choice-list-field="question-types,question-type-enum,question-type" name="..." multiple="multiple">
...
</select>

See below for an example combining this attribute with the template:multiple-choice-list-value attribute.

Syntax:

element-name|-,list-element-name,list-attribute-name[,dynamic]

Here, element-name is the element in the document being presented which contains the selected value elements; if the special value - is given then the context element is the element containing the selected value elements. The list-element-name and list-attribute-name indicate the details of the elements providing the list of selectable values. Where the optional parameter dynamic is given, the source of the multiple-choice values is considered to be found dynamically rather than from another document.

Related attributes:

Implementing attributes:

template:multiple-choice-list-value

This attribute is similar to template:multiple-choice-value in that it associates the template element on which it is used with an element holding a value in a list of selectable values, with the principal difference that potentially many such values may be selected