Latest web development tutorials

XSL-FO root 對象

XSL-FO 參考手冊 XSL-FO參考手冊

定義和用法

<fo:root> 對像是XSL-FO 文檔的根(頂級)節點。

<fo:root> 對象的子類是一個單獨的<fo:layout-master-set> 對象(該對象保留了在文檔中使用的所有頁面主[master]),一個可選的<fo:declarations>對象,以及是一個或多個<fo:page-sequence> 對象。

注意:一個XSL-FO文檔可以包含多個<fo:page-sequences>對象(舉例:文檔的每個章節都可以作為一個獨立的<fo:page-sequence>對象-它允許使用chapter-specific [具體的章節]內容,如:章節的標題,它可以被放置在頁眉或頁腳內)。


語法

<fo:root>
<!--
Children:layout-master-set,declarations?,
page-sequence+
-->
</fo:root>

屬性

属性
media-usage

實例1

XSL-FO 文檔結構如下所示:

<?xml version="1.0" encoding="ISO-8859-1"?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:layout-master-set>
<fo:simple-page-master master-name="A4">
<!-- Page template goes here -->
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="A4">
<!-- Page content goes here -->
</fo:page-sequence>

</fo:root>


XSL-FO 參考手冊 XSL-FO參考手冊