10.2 Interactively changing the effective flow

10.2.1 Dynamically changing formatting object sub-trees

The formatting objects participating in two or more renderings with dynamic changes are wrapped into a multi-switch object.

  • They are separated into individual mutually exclusive conditions.

  • Always exactly one condition is shown at a time.

    • All other conditions are hidden when not shown.

  • Operator interactivity can change which condition is shown.

    • The action of doing so will hide all conditions not being shown.

Individual conditions are wrapped by child multi-case objects.

  • There is one such child per condition.

  • It is named for reference purposes (as the target of a toggle).

  • It is titled for display purposes (when selecting from a number of cases).

Changing which condition is shown is enabled by the multi-toggle object.

  • It defines a "hot spot" on a page.

  • It encloses the flow object sub-trees sensitive to operator interaction.

    • The essence of the operator interaction is defined by the formatter.

  • You can have any number of toggles in a given sequence for different behaviors.

    • Each toggle can only change the current shown state of one other case.

      • The formatter may provide a list of case names from which the operator can choose.

        • The list is documented using the respective mandatory case titles.

      • The formatter may cycle through sibling cases in either direction.

    • A toggle can only change states amongst sibling multi-case objects.

  • Only sensitive areas need to be surrounded , not the entire content.

Descendent multi-switch objects within multi-switch objects can make for very rich presentation.

  • Properties can accommodate an ancestor multi-switch object being hidden.

    • They can restore the initial state of the descendent multi-switch object.

    • The default is to preserve the active state in the descendant regardless of the behavior of the ancestor.

  • They can be nested to any depth.

  • The stylesheet writer doesn't need to know programming, but does need to understand basic concepts of changing state as in state machines.

The XSL-FO instance effectively implements a state machine.

  • The initial state determines which object sequence is shown;

    • others are hidden.

  • Transitions to subsequent states are triggered by operator interaction

    • showing another one, hiding this one.

  • Restoration to the initial state may happen on ancestral change of state;

    • hiding the ancestor may possibly reset the descendant.

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

graphics/10fig02.gif

10.2.2 The multi-switch object

Purpose
  • This is the collection of candidate formatting object sequences from which exactly one is rendered at any given time based on an interactive condition that is influenced by the operator while being tracked by the formatter.

Content
  • ( 6.9.3 ) ( multi-case+),

  • child object:

    • multi-case ( 6.9.4 ; 274).

Property sets
  • Common accessibility properties ( 7.4 ; 326).

Other optional properties
  • auto-restore ( 7.22.2 ; 347),

  • id ( 7.28.2 ; 384).

Property of interest
  • auto-restore is used to indicate whether this multi-switch is restored to initial state when an ancestral multi-switch causes this multi-switch to be hidden.

Consider a mockup in Figure 10-3;

  • the results are presented without any user input;

  • the stylesheet chooses to use underscore to indicate to the reader the hot text to click on to expand the entry.

Figure 10-3. Dynamic objects example snapshot 1

graphics/10fig03.gif

Continuing from Figure 10-3, the display changes as shown in Figure 10-4;

  • the operator has clicked on "Thursday", thus revealing the drop-down timesheet values;

  • the stylesheet again chooses to use underscore to indicate to the reader the hot text to click on to expand the entry;

  • the stylesheet has used indentation to indicate to the reader that "Thursday" can be clicked on to collapse the entry.

Figure 10-4. Dynamic objects example snapshot 2

graphics/10fig04.gif

Continuing from Figure 10-3 again, the display changes as shown in Figure 10-5;

  • the operator has clicked on "writing", thus revealing the drop-down timesheet values;

  • collapsing the "Thursday" again will restore the original collapsed state of "writing".

Figure 10-5. Dynamic objects example snapshot 3

graphics/10fig05.gif

An excerpt from Figure 10-5 is shown in Example 10-3.

10.2.3 The multi-case object

Purpose
  • This is a single formatting object sequence that is a candidate for rendering based on an interactive condition that is influenced by the operator while being tracked by the formatter.

    • It is comprised of interaction-sensitive (using multi-toggle ) and interaction-insensitive formatting objects.

Content
  • ( 6.9.4 ) (#PCDATA %inline; %block; )* ,

  • child objects (listed alphabetically ):

    • %block; ( 6.2 ; 69),

    • %inline; ( 6.2 ; 70),

Example 10-3 Mockup of interactive markup
 Line 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> 
  • referring object:

    • multi-switch ( 6.9.3 ; 271).

Property sets
  • Common accessibility properties ( 7.4 ; 326).

Other required properties
  • case-name ( 7.22.3 ; 367),

  • case-title ( 7.22.4 ; 368).

Other optional properties
  • id ( 7.28.2 ; 384),

  • starting-state ( 7.22.10 ; 418).

Example 10-4 is again an excerpt from Figure 10-5.

10.2.4 The multi-toggle object

Purpose
  • This is the definition of the interaction-sensitive objects within a candidate sequence of formatting objects.

    • It specifies which candidate sequence is to be the rendered as a result of the interaction.

Content
  • ( 6.9.5 ) (#PCDATA %inline; %block; )* ,

  • child objects (listed alphabetically):

    • %block; ( 6.2 ; 69),

    • %inline; ( 6.2 ; 70).

  • It must be a descendant of multi-case .

Property sets
  • Common accessibility properties ( 7.4 ; 326).

Other optional properties
  • id ( 7.28.2 ; 384),

  • switch-to ( 7.22.11 ; 419).

Example 10-5 is again an excerpt from Figure 10-5.

Example 10-4 Mockup of interactive markup
 Line 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 markup
 Line 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> 


Definitive XSL-FO
Definitive XSL-FO
ISBN: 0131403745
EAN: 2147483647
Year: 2002
Pages: 99
Authors: G. Ken Holman

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net