1 <?xml version="1.0" encoding="utf-8"?>
3 <!-- example for a simple fo file. At the beginning the page layout is set.
4 Below fo:root there is always
5 - a single fo:layout-master-set which defines one or more page layouts
6 - an optional fo:declarations
7 - and a sequence of one or more fo:page-sequences containing the text and formatting instructions
10 <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
12 <fo:layout-master-set>
13 <!-- fo:layout-master-set defines in its children the page layout:
14 the pagination and layout specifications
15 - page-masters: have the role of describing the intended subdivisions
16 of a page and the geometry of these subdivisions
17 In this case there is only a simple-page-master which defines the
18 layout for all pages of the text
20 <!-- layout information -->
21 <fo:simple-page-master master-name="simple"
28 <fo:region-body margin-top="3cm" />
30 <fo:region-before extent="5.0cm" />
31 <fo:region-after extent="1.5cm"/>
32 </fo:simple-page-master>
33 </fo:layout-master-set>
34 <!-- end: defines page layout -->
37 <!-- start page-sequence
38 here comes the text (contained in flow objects)
39 the page-sequence can contain different fo:flows
40 the attribute value of master-name refers to the page layout
41 which is to be used to layout the text contained in this
43 <fo:page-sequence master-reference="simple">
44 <fo:static-content flow-name="xsl-region-before">
45 <!-- this defines a title -->
46 <fo:block font-size="24pt"
48 space-after.optimum="5pt"
49 background-color="black"
51 <fo:external-graphic src="file://${config["Producer.Image.Path"]}/banner.png" />
53 <fo:block font-size="10pt"
57 Here is where some descriptive text could go. A fair use disclaimer
58 an attribution of copyright/left rights, etc. the possibilities are endless.
59 <fo:leader leader-pattern="rule" leader-length="18cm"
60 rule-thickness="1pt" color="black"/>
67 at one (and only one) of the following:
68 xsl-region-body (usually: normal text)
69 xsl-region-before (usually: header)
70 xsl-region-after (usually: footer)
71 xsl-region-start (usually: left margin)
72 xsl-region-end (usually: right margin)
73 ['usually' applies here to languages with left-right and top-down
74 writing direction like English]
75 in this case there is only one target: xsl-region-body
77 <fo:flow flow-name="xsl-region-body">
79 <!-- each paragraph is encapsulated in a block element
80 the attributes of the block define
81 font-family and size, line-heigth etc. -->
83 <!-- here is the article title -->
84 <fo:block font-size="16pt"
85 font-family="sans-serif"
88 space-after.optimum="3pt"
93 <!-- here is the article author and date-->
94 <fo:block font-size="11pt"
95 font-family="sans-serif"
97 space-after.optimum="3pt"
99 ${article.creator}, ${article.webdb_create_formatted}
103 <!-- here is the article summary -->
104 <fo:block font-size="11pt"
105 font-family="sans-serif"
108 space-after.optimum="3pt"
109 text-align="justify">
110 ${article.description_parsed}
114 <!-- here is the header stuff -->
115 <if article.creator_main_url || article.creator_email>
116 <fo:block><fo:leader leader-pattern="rule" leader-length="18cm"
117 rule-thickness="1pt" color="black"/></fo:block>
119 <if article.creator_email>
120 <fo:block font-size="10pt"
121 font-family="sans-serif"
123 Email: ${article.creator_email}
126 <if article.creator_main_url>
127 <fo:block font-size="10pt"
128 font-family="sans-serif"
130 URL: ${article.creator_main_url}
133 <fo:block><fo:leader leader-pattern="rule" leader-length="18cm"
134 rule-thickness="1pt" color="black"/></fo:block>
136 <!-- here is the content -->
137 <fo:block font-size="12pt"
138 font-family="sans-serif"
140 space-after.optimum="3pt"
141 text-align="justify">
142 <list data.formatted_content as fc>
143 <if fc.hasImage == "1">
145 <fo:table-column column-width="${fc.img_width}px"/>
146 <fo:table-column column-width="8px"/>
147 <fo:table-column column-width="${fc.text_widthCM}cm"/>
150 <fo:table-cell display-align="center">
151 <fo:external-graphic src="file://${config["Producer.Image.Path"]}${fc.img_src}" content-height="${fc.img_height}px" content-width="${fc.img_width}px" height="${fc.img_height}px" width="${fc.img_width}px" />
152 <fo:block font-weight="bold">${fc.img_title}</fo:block>
157 <fo:block text-align="justify">${fc.text}</fo:block>
163 <fo:block text-align="justify">${fc.text}</fo:block>
172 </fo:flow> <!-- closes the flow element-->
173 </fo:page-sequence> <!-- closes the page-sequence -->