当前位置: 首页 > 网络学院 > XML相关教程 > XSL-FO > XSL-FO 文档

XSL-FO
XSL-FO 介绍
XSL-FO 文档
XSL-FO 区域
XSL-FO 输出
XSL-FO 流程
XSL-FO 页面
XSL-FO 块状区域
XSL-FO 列表
XSL-FO 表格
XSL-FO 和 XSLT
XSL-FO 软件
XSL-FO 参考资料

XSL-FO 文档


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 638 ::
收藏到网摘: n/a

XSL-FO documents are XML files with output information.
XSL-FO 文档是包含输出信息的XML文件。


XSL-FO Documents
XSL-FO文档

XSL-FO documents are XML files with output information. They contain information about the output layout and output contents.
XSL-FO文档是包含输出信息的XML文件。它们包含了与输出的布局和输出的内容相关的信息。

XSL-FO documents are stored in files with a .fo or a .fob file extension. It is also quite common to see XSL-FO documents stored with an .xml extension, because this makes them more accessible to XML editors.
XSL-FO文档以扩展名“a .fo” 或 “a .fob” 的文件保存在文件里。XSL-FO文档也通常以“an .xml” 扩展名来保存。因为这样做可以使它们能更容易被XML编辑器访问。


XSL-FO Document Structure
XSL-FO文档结构

XSL-FO documents have a structure like this:
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>

Structure explained
结构说明

XSL-FO documents are XML documents, and must always start with an XML declaration:
XSL-FO 文档是XML文档,所以必须在文档的起始处包含一份XML声明:

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

The <fo:root> element is the root element of XSL-FO documents. The root element also declares the namespace for XSL-FO:
<fo:root> 元素是XSL-FO文档的根元素。根元素也给XSL-FO声明了命名空间:

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

<!-- The full XSL-FO document goes here -->
</fo:root>

The <fo:layout-master-set> element contains one or more page templates:
<fo:layout-master-set> 元素包含了一个或多个页面模板:

<fo:layout-master-set>
<!-- All page templates go here -->
</fo:layout-master-set>

Each <fo:simple-page-master> element contains a single page template. Each template must have a unique name (master-name):
每个<fo:simple-page-master>元素包含着一个单独的页面模板。每个模板都包含一个独立的名称:

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

One or more <fo:page-sequence> elements describe the page contents. The master-reference attribute refers to the simple-page-master template with the same name:
一个或多个<fo:page-sequence>元素描述了页面内容。Master-reference 属性指的是同名的“simple-page-master” 模板。

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

</fo:page-sequence>

Note: The master-reference =  "A4" does not actually describe a predefined page format. It is just a name. You can use any name like "MyPage", "MyTemplate", etc.
注意:事实上,master-reference = "A4" 并未真正地描述预定义页面格式。它只是一个名称而已。你可以随意命名,如:"MyPage"、"MyTemplate" 等等这样的名称。

评论 (0) All

登陆 | 还没注册?