Xuất XSL-FO
- Trang trước Khu vực XSLFO
- Trang tiếp theo Luồng XSLFO
XSL-FO định nghĩa đầu ra trong phần tử <fo:flow>.
Trang (Page), luồng (Flow) và khối (Block) của XSL-FO
Nội dung 'khối' sẽ 'chảy' vào 'trang', sau đó đầu ra ra môi trường.
XSL-FO đầu ra thường được nhúng trong phần tử <fo:block>, <fo:block> nhúng trong phần tử <fo:flow>, <fo:flow> nhúng trong phần tử <fo:page-sequence>:
<fo:page-sequence> <fo:flow flow-name="xsl-region-body"> <fo:block> <!-- Output goes here --> </fo:block> </fo:flow> </fo:page-sequence>
Ví dụ XSL-FO
Bây giờ chúng ta sẽ xem một ví dụ thực tế của 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"> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4"> <fo:flow flow-name="xsl-region-body"> <fo:block>Hello CodeW3C.com</fo:block> </fo:flow> </fo:page-sequence> </fo:root>
Kết quả của mã trên đây tương tự như thế này:

- Trang trước Khu vực XSLFO
- Trang tiếp theo Luồng XSLFO