10.2.1 Dynamically changing formatting object sub-treesThe formatting objects participating in two or more renderings with dynamic changes are wrapped into a multi-switch object.
Individual conditions are wrapped by child multi-case objects.
Changing which condition is shown is enabled by the multi-toggle object.
Descendent multi-switch objects within multi-switch objects can make for very rich presentation.
The XSL-FO instance effectively implements a state machine.
Figure 10-2 shows how these constructs are nested and how the toggle constructs refer to the case constructs. Figure 10-2. The nesting of dynamically-switched formatting objects
10.2.2 The multi-switch objectPurpose
Content
Property sets
Other optional properties
Property of interest
Consider a mockup in Figure 10-3;
Figure 10-3. Dynamic objects example snapshot 1
Continuing from Figure 10-3, the display changes as shown in Figure 10-4;
Figure 10-4. Dynamic objects example snapshot 2
Continuing from Figure 10-3 again, the display changes as shown in Figure 10-5;
Figure 10-5. Dynamic objects example snapshot 3
An excerpt from Figure 10-5 is shown in Example 10-3. 10.2.3 The multi-case objectPurpose
Content
Example 10-3 Mockup of interactive markupLine 01 <list-block> 02 ... 03 <multi-switch auto-restore="true"> 04 <multi-case case-title="Roll-up writing" 05 case-name="roll-up" starting-state="show"> 06 <list-item> 07 <list-item-label><block>-</block></list-item-label> 08 <list-item-body start-indent="body-start()"> 09 <block text-decoration="underline"> 10 <multi-toggle switch-to="roll-down" 11 >writing: 2 hours</multi-toggle> 12 </block> 13 </list-item-body> 14 </list-item> 15 </multi-case> 16 <multi-case case-title="Roll-down writing" 17 case-name="roll-down" starting-state="hide"> 18 <list-item> 19 <list-item-label><block>-</block></list-item-label> 20 <list-item-body start-indent="body-start()"> 21 <block> 22 <multi-toggle switch-to="roll-up" 23 >writing: </multi-toggle> 24 </block> 25 <list-block> 26 <list-item> 27 <list-item-label><block>-</block></list-item-label> 28 <list-item-body start-indent="body-start()"> 29 <block>pfux: 2 hours</block> 30 </list-item-body> 31 </list-item> 32 </list-block> 33 </list-item-body> 34 </list-item> 35 </multi-case> 36 </multi-switch> 37 ... 38 </list-block>
Property sets
Other required properties
Other optional properties
Example 10-4 is again an excerpt from Figure 10-5. 10.2.4 The multi-toggle objectPurpose
Content
Property sets
Other optional properties
Example 10-5 is again an excerpt from Figure 10-5. Example 10-4 Mockup of interactive markupLine 01 <list-block> 02 ... 03 <multi-switch auto-restore="true"> 04 <multi-case case-title="Roll-up writing" 05 case-name="roll-up" starting-state="show"> 06 <list-item> 07 <list-item-label><block>-</block></list-item-label> 08 <list-item-body start-indent="body-start()"> 09 <block text-decoration="underline"> 10 <multi-toggle switch-to="roll-down" 11 >writing: 2 hours</multi-toggle> 12 </block> 13 </list-item-body> 14 </list-item> 15 </multi-case> 16 <multi-case case-title="Roll-down writing" 17 case-name="roll-down" starting-state="hide"> 18 <list-item> 19 <list-item-label><block>-</block></list-item-label> 20 <list-item-body start-indent="body-start()"> 21 <block> 22 <multi-toggle switch-to="roll-up" 23 >writing: </multi-toggle> 24 </block> 25 <list-block> 26 <list-item> 27 <list-item-label><block>-</block></list-item-label> 28 <list-item-body start-indent="body-start()"> 29 <block>pfux: 2 hours</block> 30 </list-item-body> 31 </list-item> 32 </list-block> 33 </list-item-body> 34 </list-item> 35 </multi-case> 36 </multi-switch> 37 ... 38 </list-block> Example 10-5 Mockup of interactive markupLine 01 02 <list-block> 03 ... 04 <multi-switch auto-restore="true"> 05 <multi-case case-title="Roll-up writing" 06 case-name="roll-up" starting-state="show"> 07 <list-item> 08 <list-item-label><block>-</block></list-item-label> 09 <list-item-body start-indent="body-start()"> 10 <block text-decoration="underline"> 11 <multi-toggle switch-to="roll-down" 12 >writing: 2 hours</multi-toggle> 13 </block> 14 </list-item-body> 15 </list-item> 16 </multi-case> 17 <multi-case case-title="Roll-down writing" 18 case-name="roll-down" starting-state="hide"> 19 <list-item> 20 <list-item-label><block>-</block></list-item-label> 21 <list-item-body start-indent="body-start()"> 22 <block> 23 <multi-toggle switch-to="roll-up" 24 >writing: </multi-toggle> 25 </block> 26 <list-block> 27 <list-item> 28 <list-item-label><block>-</block></list-item-label> 29 <list-item-body start-indent="body-start()"> 30 <block>pfux: 2 hours</block> 31 </list-item-body> 32 </list-item> 33 </list-block> 34 </list-item-body> 35 </list-item> 36 </multi-case> 37 </multi-switch> 38 ... 39 </list-block> |