O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required