10.1.1 Dynamically changing property valuesThe formatting object sub-trees sensitive to state reflection are wrapped into a multi-properties object.
A multi-properties object is a neutral construct.
The objects that are to be rendered are captured in the wrapper object.
The nesting of the constructs is illustrated in Figure 10-1. Figure 10-1. Structuring multiple sets of properties for a sequence of formatting objects
10.1.2 The multi-properties objectPurpose
Content
Property sets
Other optional property
Function of interest
Consider the need to reproduce typical browser colors for unvisited and visited links
Example 10-1 illustrates how this would be accomplished. Example 10-1 An example of using dynamic formatting propertiesLine 01 <block>This is a link: 02 <multi-properties> 03 <multi-property-set active-state="link" color="blue"/> 04 <multi-property-set active-state="visited" color="purple"/> 05 <wrapper color="merge-property-values()"> 06 <basic-link external-destination="http://www.CraneSoftwrights.com" 07 >http://www.CraneSoftwrights.com</basic-link> 08 </wrapper> 09 </multi-properties> 10 : end of block. 11 </block> 10.1.3 The multi-property-set objectPurpose
Content
Required property
Optional property
Example 10-2 highlights where this formatting object is used in the earlier example of mimicking browser colors. Example 10-2 An example of using dynamic formatting propertiesLine 01 <block>This is a link: 02 <multi-properties> 03 <multi-property-set active-state="link" color="blue"/> 04 <multi-property-set active-state="visited" color="purple"/> 05 <wrapper color="merge-property-values()"> 06 <basic-link external-destination="http://www.CraneSoftwrights.com" 07 >http://www.CraneSoftwrights.com</basic-link> 08 </wrapper> 09 </multi-properties> 10 : end of block. 11 </block> |