XML technologies / XSL-FO / XSL-FO introduction / The float concept

In practice the float concept is used for two layout goals which seem to have not much in common at first sight. One goal is the generation of texts which flow around other objects (usually images). The other goal is the placing of marginalia, meaning texts which are not included in the text flow but at the margin. The float concept is only minimally suitable for this last purpose which is nonetheless used because there is no appropriate marginalia concept in XSL-FO.

The floating element is inserted into the block in which it shall flow. For this purpose it is embedded in a <fo:float> element. The float attribute specifies where the float object shall flow in the surrounding block. The attribute value:

When using the Antenna House Formatter the attribute has two further, proprietary values:

The float object needs appropriate room in the surrounding block. This is controlled by the surrounding block element with the intrusion-displace attribute.

The attribute may contain the following values:

One example for floating text (line):

<fo:block intrusion-displace="line">
   TEXT TEXT TEXT TEXT ... TEXT TEXT TEXT
   <fo:float float="left">
      <fo:block>
         <fo:external-graphic src="hellas.bmp" content-width="30mm"/> 
      </fo:block>
   </fo:float> 
   TEXT TEXT TEXT ... TEXT TEXT TEXT 
   <fo:float float="right">
      <fo:block >   
         <fo:external-graphic src="hellas.bmp"content-width="30mm"/>
      </fo:block>
   </fo:float>
   TEXT TEXT TEXT ... TEXT TEXT TEXT 
</fo:block>

 

Formatter view

Formatter view - float concept

One example for an indented block:

<fo:block intrusion-displace="block">
   <fo:float float="right">
      <fo:block margin-left="3mm">
         MARGINALIE
         <!-- en: MARGINALIA -->
      </fo:block>
   </fo:float> 
   TEXT TEXT TEXT ... TEXT TEXT TEXT 
</fo:block>

 

Formatter view

Formatter view

back to top