XSL-FO 列表
XSL-FO 使用 <fo:list-block> 元素來定義列表。
XSL-FO 列表塊(List Blocks)
有四種 XSL-FO 對象可用來創建列表:
- fo:list-block(包含整個列表) (contains the whole list)
- fo:list-item(包含列表中的每個專案) (contains each item in the list)
- fo:list-item-label(包含用於 list-item 的標籤 - 典型地,包含一個數字或者字元的 <fo:block> )
- fo:list-item-body(包含 list-item 的內容/主體 - 典型地,一個或多個 <fo:block> 對象)
一個 XSL-FO 列表實例:
<fo:list-block>
<fo:list-item>
<fo:list-item-label>
<fo:block>*</fo:block>
</fo:list-item-label>
<fo:list-item-body>
<fo:block>Volvo</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label>
<fo:block>*</fo:block>
</fo:list-item-label>
<fo:list-item-body>
<fo:block>Saab</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
<fo:list-item>
<fo:list-item-label>
<fo:block>*</fo:block>
</fo:list-item-label>
<fo:list-item-body>
<fo:block>Volvo</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label>
<fo:block>*</fo:block>
</fo:list-item-label>
<fo:list-item-body>
<fo:block>Saab</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
上面代碼的輸出如下所示:
* Volvo * Saab |