bd:bound

Purpose

Moves or copies information from a bound element to a result element.

This template can only be used after the opening of a result element (either specified literally, or using the xsl:element element) before any content. It is an error if this template is used to move an aspect of a bound element more than once, e.g. it is valid to call this template twice to copy the element aspect from different elements, but it is not valid to call this template twice to move the element aspect from the same bound element. The presentational aspect can be used to move styles from an element, as long as each time they use different pseudo sequences.

Parameters

Name Description Type Use
aspects

A space separated list of aspects to copy from the bound element. Each aspect relates to a group of information that is to be copied. The supported aspects are:

element

It will move all out-of-band information, i.e. metadata properties that have been associated with the bound element, from the bound element to the result element. If no id parameter was provided, then it will copy the id attribute, if any, from the bound element to the result element.

presentational

Copies the styles associated with the bound element or an associated pseudo-element. If the pseudo parameter is not specified or is an empty sequence, then this aspect copies the styles associated with the bound element, i.e. not those associated with a pseudo-element. If the pseudo parameter is specified, then it identifies a pseudo-element on the specified element whose styles are copied. If the pseudo-element does not exist, no styles are copied.

component

Covers the component related information associated with the bound element. If no component-id parameter was provided, then the template will copy the component-id attribute, if any, from the bound element to the result element. The template will also copy (not move) the setting of the cf2:validation-mode meta property from the bound element to the result element. It does not do this if specified with the 'element' aspect as in that case the meta property will be moved along with all the other out-of-band information.

If the aspects parameter is not specified, then the template copies all applicable aspects from the bound element as determined by the information provided for the element in the grammar. The default set always contains the 'element' aspect. Additional aspects are added as follows: the 'presentational' aspect is added if the element is presentational, i.e. the bd:presentational attribute is not set to 'false'. The 'component' aspect is added if the element is a component, i.e. the bd:component attribute is set to 'true'.

xs:NCName optional 
component-id The optional value for the component-id attribute on the result element. If this parameter is specified, then the component-id attribute is added to the result element with the value of this parameter; this is done irrespective of whether the 'component' aspect is specified. xs:NCName optional 
element The optional bound element from which the information is copied. If not specified, then it defaults to the context item which must itself be an element (it is a fatal transformation error if it is not). element() optional 
id The optional value for the id attribute on the result element. If this parameter is specified, then the id attribute is added to the result element with the value of this parameter. This is done irrespective of whether the 'element' aspect is specified. xs:ID optional 
pseudo The sequence of pseudo-elements that identify the styles to copy from the bound element. Its behavior dependents on which aspects are specified. PseudoElement optional 

Example

Please see the topic entitled Creating a reusable component for a concrete example.

Related topics