Bonjour,
J'essaye de faire tourner une petite xsl/fo sous oXygen et Apache FOP, mais ça bloque sur une erreur 1 qui dit "First element must be the fo:root element formatting objet. Found fo:block instead".
J'ai épluché le programme dans tous les sens mais je vois pas le problème.
Si quelqu'un peut me dépanner, voici le programme :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155 <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="livre"> <xsl:processing-instruction name="140205">Phebus:140x205</xsl:processing-instruction> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="first" page-height="20.5cm" page-width="14cm" margin-top="3.18cm" margin-bottom="3.6742cm" margin-left="2.5cm" margin-right="3cm"> <fo:region-body margin-top="3.18cm" margin-bottom="3.6742cm" margin-left="2.5cm" margin-right="3cm"/> <fo:region-before extent="3.18cm"/> <fo:region-after extent="3.6742cm"/> </fo:simple-page-master> <fo:simple-page-master master-name="right" page-height="20.5cm" page-width="14cm" margin-top="1.5cm" margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm"> <fo:region-body margin-top="2cm"/> <fo:region-before extent="2.5cm"/> <fo:region-after extent="1.5cm"/> </fo:simple-page-master> <fo:simple-page-master master-name="left" page-height="20.5cm" page-width="14cm" margin-top="1.5cm" margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm"> <fo:region-body margin-top="2cm"/> <fo:region-before extent="2.5cm"/> <fo:region-after extent="1.5cm"/> </fo:simple-page-master> <fo:page-sequence-master master-name="run"> <fo:repeatable-page-master-alternatives maximum-repeats="no-limit"> <fo:conditional-page-master-reference master-reference="left" odd-or-even="even"/> <fo:conditional-page-master-reference master-reference="right" odd-or-even="odd"/> <fo:conditional-page-master-reference master-reference="title"/> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </fo:layout-master-set> <!-- end: defines page layout --> <!-- actual layout --> <!-- THIS CHANGED <fo:page-sequence master-name="run" initial-page-number="1"> --> <fo:page-sequence master-reference="run" initial-page-number="1"> <fo:static-content flow-name="xsl-region-before"> <fo:block text-align="center" font-size="10pt" font-family="serif" font-variant="Small-caps" line-height="11pt">Bifteck <fo:page-number position="end"/> </fo:block> </fo:static-content> <fo:flow flow-name="xsl-region-body" font-size="10pt" line-height="11pt"> <fo:block color="red" font-size="30pt" line-height="32pt" text-align="center" space-before.optimum="22pt"> <xsl:value-of select="/ident/auteur"/> </fo:block> <fo:block font-size="10pt" line-height="11pt" text-align="center" space-before.optimum="14pt"> <xsl:value-of select="/ident/tit"/> </fo:block> <xsl:apply-templates/> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <!-- this is the real root of the program --> <xsl:template match="livre"> <fo:block color="red" font-size="40pt" line-height="42pt" text-align="center" space-before.optimum="22pt"> <xsl:value-of select="/ident/auteur"/> </fo:block> <fo:block font-size="11pt" line-height="12.76pt" text-align="justify" text-indent="4mm" space-before.optimum="14pt"> <!-- apply templates one by one --> <xsl:apply-templates/> </fo:block> </xsl:template> <!-- ************************************************************ --> <!-- stuff in the beginning of the program --> <xsl:template match="/ident/edit"> <xsl:apply-templates/> </xsl:template> <xsl:template match="/ident/ean"> <fo:block font-size="12pt" line-height="12pt" text-align="center" space-before.optimum="12pt">Lieu: <xsl:value-of select="name"/> <!-- <xsl:value-of select="address"/> --> </fo:block> <!-- <fo:block space-before.optimum="12pt"> <fo:external-graphic src="{local-logo}" content-height="27pt" content-width="100pt" /> </fo:block> --> </xsl:template> <xsl:template match="n"> <fo:block font-size="13pt" text-align="center" space-before.optimum="24pt"> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="p"> <fo:block font-size="11pt" line-height="12.76pt" text-align="justify" text-indent="4mm"> <xsl:apply-templates/> </fo:block> </xsl:template> </xsl:stylesheet>
Partager