XSL-FO 使用 <fo:list-block> 元素來(lái)定義列表。
XSL-FO 列表塊(List Blocks)
有四種 XSL-FO 對(duì)象可用來(lái)創(chuàng)建列表:
fo:list-block(包含整個(gè)列表) (contains the whole list)
fo:list-item(包含列表中的每個(gè)項(xiàng)目) (contains each item in the list)
fo:list-item-label(包含用于 list-item 的標(biāo)簽 - 典型地,包含一個(gè)數(shù)字或者字符的 <fo:block> )
fo:list-item-body(包含 list-item 的內(nèi)容/主體 - 典型地,一個(gè)或多個(gè) <fo:block> 對(duì)象)
一個(gè) XSL-FO 列表實(shí)例:
<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 |