AFP Extensions
Extensions provide support for constructs that are not addressed by the XSL-FO standard. This provides a mechanism to render AFP specific tags into the resulting document.
AFP extensions use the "afp:" namespace identifier. To use any of the AFP extensions, add a namespace entry for http://org.apache.fop/extensions/afp to the root element:
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:afp="http://org.apache.fop/extensions/afp">
Where the AFP extensions are placed within your formatted object is not important. The reason for this is that the extensions work by being associated with an "id" attribute of an fo element, for the AFP extensions to work, the "id" attribute on the extension must correspond to an "id" attribute on an fo element within the document. In other words, the "id" attribute actually creates the "view" within the AFP document.
Tag Logical Element
An example of including a tag logical element in a page:
<afp:page id="PAG001"> <afp:tag-logical-element name="key" value="value"/> </afp:page>
Then in the formatted object create a block element that will render on the page on which the TLE is to be included, the attribute "id" must correspond to the afp:page element:
<fo:block id="PAG001"/>
See Page Group below for an example of adding a TLE to a page group
Page Group
An example of including a page group with a tag logical element:
<afp:page-group id="PGG001"> <afp:tag-logical-element name="key" value="value"/> </afp:page-group>
Then on the fo:page-sequence you include the attribute "id" corresponding to the "id" of the afp:page-group
<fo:page-sequence id="PGG001" master-reference="Chapter1">
Include Page Overlay
An example of including an include page overlay:
<afp:include-page-overlay id="IPO001" name="O1XXXXXX"/>
Then in the formatted object create a block element that will render on the page on which the overlay is to be include, the attribute "id" must correspond to the afp:include-page-overlay element:
<fo:block id="IPO001"/>
Include Page Segments
An example of including an include page overlay:
<afp:include-page-segment id="IPS001" name="XXXXXXXX"/>
Then in the formatted object create a block element that will render on the page on which the segment is to be include, the attribute "id" must correspond to the afp:include-page-segment element. Note that the position of the block element will be used to determine the co-ordinates of the IPS, therefore use the start-indent, space-before.optimum, width and height attributes to position the IPS correctly.
<fo:block id="IPS001"/>