Creating Lists
Besides tables, an XSL construct that is very close to the corresponding construct in HTML are lists. An XSL list presents a vertical arrangement of items, just as in HTML. You use four formatting objects to construct lists:
fo:list-block
fo:list-item
fo:list-item-label
fo:list-item-body
You enclose the whole list in a fo:list-block object and enclose each item in the list in a fo:list-item object. To create a label for the list item, you use a fo:list-item-label object; to insert the actual data for each list item, you use a fo:list-item-body object.
Here's an example creating a numbered list with three list items: Tic, Tac, and Toe:
Listing . ch14_10.fo
<?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> ... |
Get Real World XML now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.