aboutsummaryrefslogtreecommitdiffstats
path: root/src/foschema/fop-configuration.xsd
blob: c5a12d27f0c427d249f2f77d5ecacd7b28f632e6 (plain)
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id$ -->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified">

  <xsd:annotation>
    <xsd:documentation>This W3C schema document documents and validates the expected
      structure of a configuration file for FOP.</xsd:documentation>
  </xsd:annotation>

  <xsd:element name="fop">
    <xsd:complexType>
      <xsd:all>
        <xsd:element name="base" type="xsd:anyURI" minOccurs="0"></xsd:element>
        <xsd:element name="font-base" type="xsd:anyURI" minOccurs="0"></xsd:element>
        <xsd:element name="hyphenation-base" type="xsd:anyURI" minOccurs="0"></xsd:element>
        <xsd:element name="source-resolution"
          type="xsd:positiveInteger" minOccurs="0">
        </xsd:element>
        <xsd:element name="target-resolution"
          type="xsd:positiveInteger" minOccurs="0">
        </xsd:element>
        <xsd:element name="strict-validation" type="xsd:boolean" minOccurs="0"></xsd:element>
        <xsd:element name="break-indent-inheritance"
          type="xsd:boolean" minOccurs="0">
        </xsd:element>
        <xsd:element name="default-page-settings" minOccurs="0">
          <xsd:complexType>
            <xsd:attribute name="width" type="xsd:string"></xsd:attribute>
            <xsd:attribute name="height" type="xsd:string"></xsd:attribute>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="renderers" minOccurs="0">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="renderer" maxOccurs="unbounded"
                type="rendererType">
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:all>
      <xsd:attribute name="version" use="optional">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="1.0"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
    </xsd:complexType>
  </xsd:element>
  <xsd:complexType name="rendererType">
    <xsd:annotation>
      <xsd:documentation>This type is stricter than required by FOP, in that it imposes an
      order of the elements, which is not required by FOP.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:choice minOccurs="0">
        <xsd:sequence>
          <xsd:annotation>
            <xsd:documentation>Configuration elements used by the PDF renderer,
          MIME type application/pdf</xsd:documentation>
          </xsd:annotation>
          <xsd:element name="filterList" minOccurs="0" maxOccurs="unbounded">
            <xsd:annotation>
              <xsd:documentation>filterLists are used by the PDF renderer, MIME type
              application/pdf.</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" maxOccurs="unbounded"/>
              </xsd:sequence>
              <xsd:attribute name="type" use="optional">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="default"/>
                    <xsd:enumeration value="content"/>
                    <xsd:enumeration value="image"/>
                    <xsd:enumeration value="jpeg"/>
                    <xsd:enumeration value="tiff"/>
                    <xsd:enumeration value="font"/>
                    <xsd:enumeration value="metadata"/>
                    <!-- Available values: see PDFFilterList.java -->
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:attribute>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="output-profile" type="xsd:string" minOccurs="0">
            <xsd:annotation>
              <xsd:documentation>Output color profile used by the PDF renderer. Specifies a 
              filename to an ICC file.</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <xsd:sequence>
          <xsd:annotation>
            <xsd:documentation>Configuration elements used by the PostScript renderer,
          MIME type application/postscript</xsd:documentation>
          </xsd:annotation>
          <xsd:element name="auto-rotate-landscape">
            <xsd:annotation>
              <xsd:documentation>auto-rotate-landscape is used by the PostScript renderer,
            MIME type application/postscript.</xsd:documentation>
            </xsd:annotation>
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="false"/>
                <xsd:enumeration value="true"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
        </xsd:sequence>
        <xsd:sequence>
          <xsd:annotation>
            <xsd:documentation>rendering and text-rendering are used by the PCL renderer,
          MIME type application/vnd.hp-PCL</xsd:documentation>
          </xsd:annotation>
          <xsd:element name="rendering" minOccurs="0">
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="speed"/>
                <xsd:enumeration value="quality"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
          <xsd:element name="text-rendering" minOccurs="0">
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="auto"/>
                <xsd:enumeration value="bitmap"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
        </xsd:sequence>
        <xsd:sequence>
          <xsd:annotation>
            <xsd:documentation>The elements in this sequence apply only to the bitmap renderers (PNG and TIFF).</xsd:documentation>
          </xsd:annotation>
          <xsd:element name="transparent-page-background" type="xsd:boolean" default="false" minOccurs="0"/>
        </xsd:sequence>
        <xsd:sequence>
          <xsd:annotation>
            <xsd:documentation>The elements in this sequence apply only to the text renderer,
          MIME type text/plain.</xsd:documentation>
          </xsd:annotation>
          <xsd:element name="encoding" type="xsd:string" default="UTF-8" minOccurs="0"/>
        </xsd:sequence>
      </xsd:choice>
      <xsd:sequence>
        <xsd:annotation>
          <xsd:documentation>The elements in this sequence apply only to the TIFF renderer,
        MIME type image/tiff.</xsd:documentation>
        </xsd:annotation>
        <xsd:element name="compression" type="xsd:string" minOccurs="0"/>
      </xsd:sequence>
      <xsd:element name="fonts" minOccurs="0">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="font" type="fontType" maxOccurs="unbounded"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="xml-handler" minOccurs="0" maxOccurs="unbounded">
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension base="xsd:anyType"/>
          </xsd:complexContent>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="mime" type="MimeConstants" use="required"/>
  </xsd:complexType>
  <xsd:complexType name="fontType">
    <xsd:sequence>
      <xsd:element name="font-triplet" type="fontTripletType" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="metrics-url" type="xsd:anyURI" use="required"/>
    <xsd:attribute name="embed-url" type="xsd:anyURI" use="optional"/>
    <xsd:attribute name="kerning" use="optional" default="no">
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value="yes"/>
          <xsd:enumeration value="no"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
  </xsd:complexType>
  <xsd:complexType name="fontTripletType">
    <xsd:attribute name="name" type="xsd:string" use="required"/>
    <xsd:attribute name="style" type="xsd:string" use="required"/>
    <xsd:attribute name="weight" type="xsd:string" use="required"/>
  </xsd:complexType>
  <xsd:simpleType name="MimeConstants">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="application/pdf"/>
      <xsd:enumeration value="application/postscript"/>
      <xsd:enumeration value="application/x-pcl"/>
      <xsd:enumeration value="application/vnd.hp-PCL"/>
      <xsd:enumeration value="application/x-afp"/>
      <xsd:enumeration value="application/vnd.ibm.modcap"/>
      <xsd:enumeration value="text/plain"/>
      <xsd:enumeration value="application/rtf"/>
      <xsd:enumeration value="text/richtext"/>
      <xsd:enumeration value="text/rtf"/>
      <xsd:enumeration value="application/mif"/>
      <xsd:enumeration value="application/X-fop-awt-preview"/>
      <xsd:enumeration value="application/X-fop-print"/>
      <xsd:enumeration value="application/X-fop-areatree"/>
      <xsd:enumeration value="image/png"/>
      <xsd:enumeration value="image/tiff"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:schema>