summaryrefslogtreecommitdiff
path: root/man/man1/xmlto.1
blob: 7784663df9a594539b520d38b7d09b4dbb4a30b7 (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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
'\" t
.\"     Title: xmlto
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: November 2011
.\"    Manual: Reference
.\"    Source: xmlto 0.0.25
.\"  Language: English
.\"
.TH "XMLTO" "1" "November 2011" "xmlto 0.0.25" "Reference"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
xmlto \- apply an XSL stylesheet to an XML document
.SH "SYNOPSIS"
.HP \w'\fBxmlto\fR\ 'u
\fBxmlto\fR [\fB\-o\fR\ \fIoutput_dir\fR] [\fB\-x\fR\ \fIcustom_xsl\fR] [\fB\-m\fR\ \fIxsl_fragment\fR] [\fB\-v\fR] [\fB\-p\fR\ \fIpostprocessor_opts\fR] [\fB\-\-extensions\fR] [\fB\-\-searchpath\fR\ \fIpath\fR] [\fB\-\-skip\-validation\fR] [\fB\-\-stringparam\fR\ \fIparamname\fR=\fIparamvalue\fR] [\fB\-\-noclean\fR] [\fB\-\-noautosize\fR] [\fB\-\-noextensions\fR] [\fB\-\-with\-fop\fR] [\fB\-\-with\-dblatex\fR] {\fIformat\fR} {\fIfile\fR}
.HP \w'\fBxmlto\fR\ 'u
\fBxmlto\fR {[\-\-help] | [\-\-version]}
.SH "DESCRIPTION"
.PP
The purpose of
\fBxmlto\fR
is to convert an XML
\fIfile\fR
to the desired
\fIformat\fR
using whatever means necessary\&. This may involve two steps:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  1." 4.2
.\}
The application of an appropriate XSL stylesheet using an XSL\-T processor\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  2." 4.2
.\}
Further processing with other tools\&. This step may not be necessary\&.
.RE
.PP
To decide which stylesheet to use and what, if any, needs to be done to post\-process the output,
\fBxmlto\fR
makes use of
format scripts, which are simple shell scripts that
\fBxmlto\fR
calls during the conversion\&.
.PP
The appropriate format script is selected based on the type of XML file and the desired output format\&.
\fBxmlto\fR
comes with some format scripts for converting DocBook XML files to a variety of formats\&. You may specify your own format script by using an absolute filename for
\fIformat\fR
on the command line\&.
.PP
Firstly, if
\fBxmlto\fR
has not been told explicitly which stylesheet to use (with the
\fB\-x\fR
option), the format script will be called with
\fB$1\fR
set to
stylesheet\&. The environment variable
\fBXSLT_PROCESSOR\fR
contains the base name of the executable that will be used to perform the XSL\-T transformation (for example
xsltproc)\&. The format script should write the name of the stylesheet to use to standard output and exit successfully, or exit with a non\-zero return code if there is no appropriate stylesheet to use (for example, if the only available stylesheet is known not to work with the XSL\-T processor that will be used)\&. If nothing is written to standard output but the script exits successfully, no XSL\-T transformation will be performed\&.
.PP
Secondly, after an XSL\-T processor has been run using the stylesheet, the format script will be called again, this time with
\fB$1\fR
set to
post\-process\&. The format script should perform any necessary steps to translate the XSL\-T processed output into the desired output format, including copying the output to the desired output directory\&. For post\-processing, the format script is run in a temporary directory containing just the processed output (whose name is stored in
\fBXSLT_PROCESSED\fR
and whose basename is that of the original XML file with any filename extension replaced with
\&.proc)\&.
\fBINPUT_FILE\fR
is set to the name of the original XML file,
\fBOUTPUT_DIR\fR
is set to the name of the directory that the output (and only the output) must end up in, and
\fBSEARCHPATH\fR
is set to a colon\-separate list of fallback directories in which to look for input (for images, for example)\&. If this step is unsuccessful the format script should exit with a non\-zero return code\&.
.SH "OPTIONS"
.PP
\fB\-v\fR
.RS 4
Be verbose (\fB\-vv\fR
for very verbose)\&.
.RE
.PP
\fB\-x\fR \fIstylesheet\fR
.RS 4
Use
\fIstylesheet\fR
instead of asking the format script to choose one\&.
.RE
.PP
\fB\-m\fR \fIfragment\fR
.RS 4
Use the provided XSL
\fIfragment\fR
to modify the stylesheet\&.
.RE
.PP
\fB\-o\fR \fIdirectory\fR
.RS 4
Put output in the specified
\fIdirectory\fR
instead of the current working directory\&.
.RE
.PP
\fB\-p\fR \fIpostprocessor_opts\fR
.RS 4
Pass
\fIpostprocessor_opts\fR
to processing stages after stylesheet application (e\&.g\&.
lynx
or
links
when going through HTML to text, or
xmltex
when going from through TeX to DVI)\&. If
\fB\-p\fR
is specified a second time, the options specified will be passed to second\-stage postprocessing; presently this is only applicable when going through
xmltex
and
dvips
to PostScript\&.
.RE
.PP
\fB\-\-extensions\fR
.RS 4
Turn on stylesheet extensions for the tool chain in use (\fIuse\&.extensions\fR
is turned on)\&. The variables turned on are the ones used by Norman Walsh\*(Aqs DocBook XSL stylesheets\&.
.RE
.PP
\fB\-\-searchpath\fR \fIpath\fR
.RS 4
Add the colon\-separated list of directories in
\fIpath\fR
as fallback directories for including input\&.
.RE
.PP
\fB\-\-skip\-validation\fR
.RS 4
Skip the validation step that is normally performed\&.
.RE
.PP
\fB\-\-stringparam\fR \fIparamname\fR=\fIparamvalue\fR
.RS 4
Pass a named parameter
\fIparamname\fR
with value
\fIparamvalue\fR
to stylesheet from the command line\&.
.RE
.PP
\fB\-\-noclean\fR
.RS 4
Temporary files are not deleted(their names are shown and kept in tmp directory)\&. It could help with analyzing problems\&.
.RE
.PP
\fB\-\-noautosize\fR
.RS 4
By default, some XSL variables are overriden by autodetection (\fIpage\&.width\fR
and
\fIpage\&.height\fR
for
paperconf
(libpaper) use,
\fIpaper\&.type\fR
for locale\-based (\fBLC_PAPER\fR) selection)\&. With this option,
\fBxmlto\fR
doesn\(cqt use this autodetection and user is able to modify defaults himself (either via default
param\&.xsl
modification or by user\-defined XSL fragment)\&.
.RE
.PP
\fB\-\-noextensions\fR
.RS 4
By default,
\fBxmlto\fR
enables XSL params
\fIpassivetex\&.extensions\fR
for
passivetex
backend and
\fIfop\&.extensions\fR
and
\fIfop1\&.extensions\fR
for
fop
backend\&. This usually produces better results\&. If you for some reason don\*(Aqt want to use these parameters, just disable them using this option\&.
.RE
.PP
\fB\-\-with\-fop\fR
.RS 4
Use
fop
for formatting\&. It is an experimental option, expects
fop
in specific location(detected at configured time), could be changed manually in
\fBxmlto\fR
script by modification of
\fIFOP_PATH\fR
.RE
.PP
\fB\-\-with\-dblatex\fR
.RS 4
Use
dblatex
for formatting\&. It is an experimental option, expects
dblatex
in specific location(detected at configured time), could be changed manually in
\fBxmlto\fR
script by modification of
\fIDBLATEX_PATH\fR
.RE
.PP
\fB\-\-help\fR
.RS 4
Display a short usage message\&. It will describe xmlto\*(Aqs options, and the available output formats\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Display the version number of xmlto\&.
.RE
.SH "ENVIRONMENT"
.PP
\fBXSLT_PROCESSOR\fR
.RS 4
Base name of the executable that will be used to perform the XSL\-T transformation (default:
\fBxsltproc\fR(1))\&.
.RE
.PP
\fBTMPDIR\fR
.RS 4
Directory, where to create temporary stylesheets (default:
/tmp)\&.
.RE
.SH "DIAGNOSTICS"
.PP
\fB0\fR
.RS 4
Everything went fine\&. This is the expected exit code\&.
.RE
.PP
\fB1\fR
.RS 4
\fBxmlto\fR
was called with insufficient arguments\&.
.RE
.PP
\fB2\fR
.RS 4
\fBmktemp\fR(1)
failed to create a file/directory\&. Make sure
/tmp
or
\fBTMPDIR\fR
is writable\&.
.RE
.PP
\fB3\fR
.RS 4
\fBxmlto\fR
failed to find some binary on configured location\&. Make sure that all required packages are installed and paths in
xmlto
script are set properly\&.
.RE
.PP
\fB10+(Validation non\-zero error code)\fR
.RS 4
\fBxmlto\fR
tried to validate a xml document, but validation failed\&. For better diagnostic, validation output and
xmllint
exit code is provided\&. Consider either fixing your document or using
\fB\-\-skip\-validation\fR\&.
.RE
.SH "EXAMPLES"
.PP
To convert a DocBook XML document to PDF, use:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBxmlto pdf mydoc\&.xml\fR
.fi
.if n \{\
.RE
.\}
.PP
To convert a DocBook XML document to HTML and store the resulting HTML files in a separate directory use:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBxmlto \-o html\-dir html mydoc\&.xml\fR
.fi
.if n \{\
.RE
.\}
.PP
To convert a DocBook XML document to a single HTML file use:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBxmlto html\-nochunks mydoc\&.xml\fR
.fi
.if n \{\
.RE
.\}
.PP
To modify the output using an XSL fragment use:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBxmlto \-m ulink\&.xsl pdf mydoc\&.xml\fR
.fi
.if n \{\
.RE
.\}
.PP
To specify which stylesheet to use (overriding the one that the format script would choose) use:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBxmlto \-x mystylesheet\&.xsl pdf mydoc\&.xml\fR
.fi
.if n \{\
.RE
.\}
.SH "AUTHORS"
.PP
\fBTim Waugh\fR <\&twaugh@redhat.com\&>
.RS 4
Original author, maintainer until 0.0.18
.RE
.PP
\fBOndřej Va\(vs\('ik\fR <\&ovasik@redhat.com\&>
.RS 4
Maintainer since 0.0.19
.RE
.SH "COPYRIGHT"
.br