Table of contentsAppendices |
6.11 Other Formatting ObjectsOther Formatting ObjectsIntroduction[top]IntroductionThe following example shows the use of the fo:wrapper formatting object that has no semantics but acts as a "carrier" for inherited properties. Example[top]ExampleInput sample: <doc> <p>This is an <emph>important word</emph> in this sentence that also refers to a <code>variable</code>.</p> </doc> The "emph" elements are to be presented using a bold font and the "code" elements using a Courier font. XSL Stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="emph">
<fo:wrapper font-weight="bold">
<xsl:apply-templates/>
</fo:wrapper>
</xsl:template>
<xsl:template match="code">
<fo:wrapper font-family="Courier">
<xsl:apply-templates/>
</fo:wrapper>
</xsl:template>
</xsl:stylesheet>
fo: element and attribute tree: <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">This is an <fo:wrapper font-weight="bold">important word</fo:wrapper> in this sentence that also refers to a <fo:wrapper font-family="Courier">variable</fo:wrapper>. </fo:block> fo:wrapper[top]fo:wrapperCommon Usage: The fo:wrapper formatting object is used to specify inherited properties for a group of formatting objects. Areas: The fo:wrapper formatting object does not generate any areas. The fo:wrapper formatting object returns the sequence of areas created by concatenating the sequences of areas returned by each of the children of the fo:wrapper. Trait Derivation: Except for "id", the fo:wrapper has no properties that are directly used by it. However, it does serve as a carrier to hold inheritable properties that are utilized by its children. Constraints: The order of concatenation of the sequences of areas returned by the children of the fo:wrapper is the same order as the children are ordered under the fo:wrapper. Contents: (#PCDATA|%inline;|%block;)* An fo:wrapper is only permitted to have children that would be permitted to be children of the parent of the fo:wrapper, with two exceptions:
This restriction applies recursively. NOTE: The following properties apply to this formatting object: fo:marker[top]fo:markerCommon Usage: The fo:marker is used in conjunction with fo:retrieve-marker to produce running headers or footers. Typical examples include:
The fo:marker has to be an initial child of its parent formatting object. Areas: The fo:marker does not directly produce any area. Its children may be retrieved and formatted from within an fo:static-content, using an fo:retrieve-marker whose "retrieve-class-name" property value is the same as the "marker-class-name" property value of this fo:marker. Constraints: An fo:marker is only permitted as the descendant of an fo:flow. Note: Property values set on an fo:marker or its ancestors will not be inherited by the children of the fo:marker when they are retrieved by an fo:retrieve-marker. It is an error if two or more fo:markers that share the same parent have the same "marker-class-name" property value. Contents: (#PCDATA|%inline;|%block;)* An fo:marker may contain any formatting objects that are permitted as a replacement of any fo:retrieve-marker that retrieves the fo:marker's children. The following properties apply to this formatting object: fo:retrieve-marker[top]fo:retrieve-markerCommon Usage: The fo:retrieve-marker is used in conjunction with fo:marker to produce running headers or footers. Typical examples include:
Areas: The fo:retrieve-marker does not directly generate any area. It is (conceptually) replaced by the children of the fo:marker that it retrieves. Trait Derivation: The properties and traits specified on the ancestors of the fo:retrieve-marker are taken into account when formatting the children of the retrieved fo:marker as if the children had the same ancestors as the fo:retrieve-marker. Constraints: An fo:retrieve-marker is only permitted as the descendant of an fo:static-content. The fo:retrieve-marker specifies that the children of a selected fo:marker shall be formatted as though they replaced the fo:retrieve-marker in the formatting tree. The properties of the fo:retrieve-marker impose a hierarchy of preference on the areas of the area tree. Each fo:marker is conceptually attached to each normal area returned by the fo:marker's parent formatting object. Additionally, an fo:marker is conceptually attached to each non-normal area that is directly generated by the fo:marker's parent formatting object. Conversely, areas generated by any descendant of an fo:flow may have zero or more fo:marker's conceptually attached. The fo:marker whose children are retrieved is the one that is (conceptually) attached to the area that is at the top of this hierarchy. Every area in the hierarchy is considered preferential to, or "better" than, any area below it in the hierarchy. When comparing two areas to determine which one is better, the terms "first" and "last" refer to the pre-order traversal order of the area tree. The term "containing page" is used here to mean the page that contains the first area generated or returned by the children of the retrieved fo:marker. An area that has an attached fo:marker whose "marker-class-name" property value is the same as the "retrieve-class-name" property value of the fo:retrieve-marker is defined to be a qualifying area. Only qualifying areas have positions in the hierarchy. A qualifying area within a page is better than any qualifying area within a preceding page, except that areas do not have a position in the hierarchy if they are within pages that follow the containing page. If the "retrieve-boundary" property has a value of "page-sequence", then an area does not have a position in the hierarchy if it is on a page from a page-sequence preceding the page-sequence of the containing page. If the "retrieve-boundary" property has a value of "page", then an area does not have a position in the hierarchy if it is not on the containing page. If the value of the "retrieve-position" property is "first-starting-within-page", then the first qualifying area in the containing page whose "is-first" trait has a value of "true" is better than any other area. If there is no such area, then the first qualifying area in the containing page is better than any other area. If the value of the "retrieve-position" property is "first-including-carryover", then the first qualifying area in the containing page is better than any other area. If the value of the "retrieve-position" property is "last-starting-within-page", then the last qualifying area in the containing page whose "is-first" trait has a value of "true" is better than any other area. If there is no such area, then the last qualifying area in the containing page is better than any other area. If the value of the "retrieve-position" property is "last-ending-within-page", then the last qualifying area in the containing page whose "is-last" trait has a value of "true" is better than any other area. If there is no such area, then the last qualifying area in the containing page is better than any other area. If the hierarchy of areas is empty, no formatting objects are retrieved. Contents: EMPTY The following properties apply to this formatting object: |