4.2 Block and inline basics

4.2.1 Simple block and inline objects

The wrapper object is a semantic-free container used by other objects or for inherited properties.

  • It does not generate any areas by itself.

    • It returns the areas generated by its descendants.

  • It is used by multi-properties as a wrapper for the objects to which the multiple properties apply.

  • It can be a generic branch in the formatting object tree from which descendent objects obtain inherited property settings.

Empty wrappers are not useful constructs.

  • Area tree will not have any child areas to which an id property is attached.

Line properties for a given block can be set by different objects.

  • block :

    • has one property for the first line in the block;

      • text-indent :

        • with a positive value, incurs into the block (indent),

        • with a negative value, hangs outside the block (outdent);

    • has two properties for the last line in the block;

      • last-line-end-indent :

        • with a positive value, incurs into the block (indent),

        • with a negative value, hangs outside the block (outdent);

      • text-align-last :

        • governs the alignment of only the last line in the block;

    • has a number of properties for all lines in the block (including first and last).

      • Note that for text-align , the value " justify " doesn't apply to the last line of the block.

  • initial-property-set :

    • is solely a container of properties applicable to the first line;

      • only the formatter can determine how much of the flowed information in the block will end up on the first line of the block;

      • neither XSLT nor any other XSL-FO generation process can know ahead of time how much will be formatted on the first line of a block;

    • must be a child of the block defining the lines to be influenced.

  • The line of a single-line block is considered to be both the first line and the last line of the block.

Constructs designed to be used only inline can be rendered on their own line.

  • Inline constructs cannot live between two blocks, e.g.:

    • graphics rendered between paragraphs,

    • a rule-styled leader rendered between paragraphs.

  • To render an inline construct between two blocks, it must be placed within its own block.

Inline areas can have non-inheritable properties set for the area contents.

  • inline :

    • is distinct from wrapper in that it creates an area in the area tree,

    • is necessary for properties such as baseline-shift for doing superscript and subscript of the contained text.

The formatter can supply glyphs to be rendered in a line.

  • Consider page-number -citation ;

    • the format of the glyphs is dictated by the page sequence for the cited area;

    • e.g., consider a book with the front matter pages numbered in lower-case roman numerals and the book body pages, in digits;

      • citing a page of the body when in the front matter returns the digits as used in the body;

      • citing a page of the front matter when in the body returns the roman numerals as used in the front matter.

page-number-citation can also be used to generate a total page count.

  • Citing the page number of the last page of the document gives the total page count.

  • An empty block with an area with zero dimensions can be flowed on the last page.

    • It's provably not robust for all possible documents, but this works for most documents and is the only way possible in XSL-FO 1.0.

    • Nuances of interaction with floats, float separator sub- regions , and discarded space specifications prevent guaranteed page numbering.

  • When using XSLT, here's a tip to guarantee uniqueness of the last block identifier.

    • Use id="{ generate-id (/)}" to identify the last block of the document.

      • The root node of the source node tree cannot be referenced by IDREF.

      • It is guaranteed to be unique among all source documents' uses of IDREF if all identifiers are translated using the generate-id() function.

4.2.2 The wrapper object

Purpose
  • This is a neutral container construct for specifying inherited properties for descendent constructs.

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

  • child objects (listed alphabetically ):

    • %block; ( 6.2 ; 69),

    • %inline; ( 6.2 ; 70),

  • referring object:

    • multi-properties ( 6.9.6 ; 268),

  • any number of marker children at the beginning.

Optional property
  • id ( 7.28.2 ; 384).

4.2.3 The block object

Purpose
  • This is the description of canvas content that is distinct from its preceding area content.

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

  • child objects (listed alphabetically):

    • %block; ( 6.2 ; 69),

    • %inline; ( 6.2 ; 70),

  • these objects at the beginning (in the following order):

    • zero or more marker objects,

    • at most one initial-property-set object.

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

  • common aural properties ( 7.6 ; 327),

  • common border, padding, and background properties ( 7.7 ; 328),

  • common font properties ( 7.8 ; 331),

  • common hyphenation properties ( 7.9 ; 332),

  • common margin properties block ( 7.10 ; 332),

  • common relative position properties ( 7.12 ; 333).

Other optional properties
  • break-after ( 7.19.1 ; 366),

  • break-before ( 7.19.2 ; 367),

  • color ( 7.17.1 ; 369),

  • hyphenation-keep ( 7.15.1 ; 383),

  • hyphenation-ladder-count ( 7.15.2 ; 383),

  • id ( 7.28.2 ; 384),

  • intrusion- displace ( 7.18.3 ; 385),

  • keep-together ( 7.19.3 ; 386),

  • keep-with- next ( 7.19.4 ; 386),

  • keep-with-previous ( 7.19.5 ; 387),

  • last-line-end-indent ( 7.15.3 ; 387),

  • linefeed -treatment ( 7.15.7 ; 391),

  • line-height ( 7.15.4 ; 390),

  • line-height-shift-adjustment ( 7.15.5 ; 390),

  • line-stacking-strategy ( 7.15.6 ; 391),

  • orphans ( 7.19.6 ; 396),

  • span ( 7.20.4 ; 415),

  • text-align ( 7.15.9 ; 421),

  • text-align-last ( 7.15.10 ; 421),

  • text-altitude ( 7.27.4 ; 421),

  • text-depth ( 7.27.5 ; 422),

  • text-indent ( 7.15.11 ; 422),

  • visibility ( 7.28.8 ; 425),

  • white-space -collapse ( 7.15.12 ; 427),

  • white-space-treatment ( 7.15.8 ; 427),

  • widows ( 7.19.7 ; 427),

  • wrap-option ( 7.15.13 ; 428).

Shorthands influencing the above properties
  • font ( 7.29.13 ; 377),

  • page-break-after ( 7.29.16 ; 401),

  • page-break-before ( 7.29.17 ; 401),

  • page-break-inside ( 7.29.18 ; 402).

Property of interest
  • clear :

    • applies but is not included in the list of properties in the Recommendation,

    • specifies whether a block clears a side-float.

4.2.4 Preserving white space

It is often necessary to preserve the exact text content of an element, e.g.:

  • see example on Section 2.2.2,

  • in program listings,

  • in markup listings,

  • in text drawings.

A combination of properties is required to ensure all text is preserved.

  • linefeed-treatment="preserve" :

    • preserves linefeed characters during refined formatting object tree generation;

  • white-space-treatment="preserve" :

    • preserves white space around linefeed characters during refined formatting object tree generation;

  • white-space-collapse="false" :

    • preserves consecutive white space during area tree generation.

Optionally, one could also specify the behavior of content which is too long for a line.

  • wrap-option="no-wrap" :

    • clips the line and triggers an overflow error for lines that are too long.

Note that all four properties can be manipulated using the white-space shorthand.

  • Remember that shorthand properties are not required to be supported by a processor.

4.2.5 The initial-property-set object

Purpose
  • This is an auxiliary construct for specifying properties applied to the first line of the parent block.

    • The information to which the properties applies is determined by the formatter and not by the generation of the block.

Content
  • ( 6.6.4 ) EMPTY .

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

  • common aural properties ( 7.6 ; 327),

  • common border, padding, and background properties ( 7.7 ; 328),

  • common font properties ( 7.8 ; 331),

  • common relative position properties ( 7.12 ; 333).

Other optional properties
  • color ( 7.17.1 ; 369),

  • id ( 7.28.2 ; 384),

  • letter-spacing ( 7.16.2 ; 389),

  • line-height ( 7.15.4 ; 390),

  • score-spaces ( 7.28.6 ; 412),

  • text-decoration ( 7.16.4 ; 422),

  • text-shadow ( 7.16.5 ; 423),

  • text-transform ( 7.16.6 ; 423),

  • word-spacing ( 7.16.8 ; 428).

Shorthand influencing the above properties
  • font ( 7.29.13 ; 377).

4.2.6 The inline object

Purpose
  • This is the specification of inherited and non-inherited properties for content within a line generated in a block.

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

  • child objects (listed alphabetically):

    • %block; ( 6.2 ; 69),

    • %inline; ( 6.2 ; 70),

  • referring object:

    • footnote ( 6.10.3 ; 237),

  • any number of marker children at the beginning.

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

  • common aural properties ( 7.6 ; 327),

  • common border, padding, and background properties ( 7.7 ; 328),

  • common font properties ( 7.8 ; 331),

  • common margin properties inline ( 7.11 ; 333),

  • common relative position properties ( 7.12 ; 333).

Other optional properties
  • alignment-adjust ( 7.13.1 ; 346),

  • alignment-baseline ( 7.13.2 ; 346),

  • baseline-shift ( 7.13.3 ; 351),

  • block-progression-dimension ( 7.14.1 ; 352),

  • color ( 7.17.1 ; 369),

  • dominant-baseline ( 7.13.5 ; 374),

  • height ( 7.14.4 ; 382),

  • id ( 7.28.2 ; 384),

  • inline-progression-dimension ( 7.14.5 ; 385),

  • keep-together ( 7.19.3 ; 386),

  • keep-with-next ( 7.19.4 ; 386),

  • keep-with-previous ( 7.19.5 ; 387),

  • line-height ( 7.15.4 ; 390),

  • text-decoration ( 7.16.4 ; 422),

  • visibility ( 7.28.8 ; 425),

  • width ( 7.14.12 ; 428),

  • wrap-option ( 7.15.13 ; 428).

Shorthands influencing the above properties
  • font ( 7.29.13 ; 377),

  • page-break-after ( 7.29.16 ; 401),

  • page-break-before ( 7.29.17 ; 401),

  • page-break-inside ( 7.29.18 ; 402),

  • vertical-align ( 7.29.22 ; 424).

Properties of interest
  • baseline-shift is used for subscripting and superscripting;

  • text-decoration is used for underscored text;

  • font-style is used for italicized text;

  • font-weight is used for boldfaced text.

4.2.7 The page-number-citation object

Purpose
  • This is an inline-level placeholder replaced with the page number of the first normal area of cited formatting object using the format of the page numbers for the page sequence in which the cited area is found.

Content
  • ( 6.6.11 ) EMPTY .

  • This object is used as an inline-level object;

    • the number value is converted to a string according to page-sequence format property using XSLT format strings.

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

  • common aural properties ( 7.6 ; 327),

  • common border, padding, and background properties ( 7.7 ; 328),

  • common font properties ( 7.8 ; 331),

  • common margin properties inline ( 7.11 ; 333),

  • common relative position properties ( 7.12 ; 333).

Other required property
  • ref-id ( 7.28.5 ; 407).

Other optional properties
  • alignment-adjust ( 7.13.1 ; 346),

  • alignment-baseline ( 7.13.2 ; 346),

  • baseline-shift ( 7.13.3 ; 351),

  • dominant-baseline ( 7.13.5 ; 374),

  • id ( 7.28.2 ; 384),

  • keep-with-next ( 7.19.4 ; 386),

  • keep-with-previous ( 7.19.5 ; 387),

  • letter-spacing ( 7.16.2 ; 389),

  • line-height ( 7.15.4 ; 390),

  • score-spaces ( 7.28.6 ; 412),

  • text-altitude ( 7.27.4 ; 421),

  • text-decoration ( 7.16.4 ; 422),

  • text-depth ( 7.27.5 ; 422),

  • text-shadow ( 7.16.5 ; 423),

  • text-transform ( 7.16.6 ; 423),

  • visibility ( 7.28.8 ; 425),

  • word-spacing ( 7.16.8 ; 428),

  • wrap-option ( 7.15.13 ; 428).

Shorthands influencing the above properties
  • font ( 7.29.13 ; 377),

  • page-break-after ( 7.29.16 ; 401),

  • page-break-before ( 7.29.17 ; 401),

  • vertical-align ( 7.29.22 ; 424).

Property of interest
  • ref-id must point to an area with an identifier on the desired page.



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

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