1XSLTPROC(1) xsltproc Manual XSLTPROC(1)
2
3
4
6 xsltproc - command line XSLT processor
7
8
10 .HP 216u
11
12 xsltproc [ [
13 | -V | --version ]
14 [ | -v | --verbose
15 ] [ {
16 | -o | --output
17 } {
18 | FILE | DIRECTORY }
19 ] | --timing | --repeat
20 | --debug | --novalid |
21 --noout | --maxdepth VALUE | --html
22 | --encoding ENCODING |
23 --param PARAMNAME PARAMVALUE |
24 --stringparam PARAMNAME PARAMVALUE | --nonet
25 | --path "PATH(S)" | --load-trace
26 | --catalogs | --xinclude
27 | [ | --profile | --norman ] |
28 --dumpextensions | --nowrite |
29 --nomkdir | --writesubtree PATH |
30 --nodtdattr ] [STYLESHEET] {
31 | XML-FILE... | - }
32
33
34
36 .PP xsltproc is a command line tool for applying XSLT
37 stylesheets to XML documents. It is part of libxslt(3), the XSLT C
38 library for GNOME. While it was developed as part of the GNOME project,
39 it can operate independently of the GNOME desktop.
40
41 .PP xsltproc is invoked from the command line with the name of the
42 stylesheet to be used followed by the name of the file or files to
43 which the stylesheet is to be applied. It will use the standard input
44 if a filename provided is - .
45
46 .PP If a stylesheet is included in an XML document with a
47 Stylesheet Processing Instruction, no stylesheet need to be named at
48 the command line. xsltproc will automatically detect the included
49 stylesheet and use it.
50
51 .PP By default, output is to stdout. You can specify a file for
52 output using the -o or --output option.
53
54
55
57 .PP xsltproc accepts the following options (in alphabetical
58 order):
59
60
61
62
63 .PP --catalogs
64
65 Use the SGML catalog specified in
66 SGML_CATALOG_FILES to resolve the location of external entities. By
67 default, xsltproc looks for the catalog specified in
68 XML_CATALOG_FILES. If that is not specified, it uses
69 /etc/xml/catalog.
70
71 .RE
72
73 .PP --debug
74
75 Output an XML tree of the transformed
76 document for debugging purposes.
77
78 .RE
79
80 .PP --dumpextensions
81
82 Dumps the list of all registered
83 extensions on stdout.
84
85 .RE
86
87 .PP --html
88
89 The input document is an HTML
90 file.
91
92 .RE
93
94 .PP --load-trace
95
96 Display all the documents
97 loaded during the processing to stderr.
98
99 .RE
100
101 .PP --maxdepth VALUE
102
103 Adjust the maximum depth
104 of the template stack before libxslt(3)
105 concludes it is in an infinite loop. The
106 default is 3000.
107
108 .RE
109
110 .PP --nodtdattr
111
112 Do not apply default
113 attributes from the document's DTD.
114
115 .RE
116
117 .PP --nomkdir
118
119 Refuses to create
120 directories.
121
122 .RE
123
124 .PP --nonet
125
126 Do not use
127 the Internet to fetch DTDs,
128 entities or documents.
129
130 .RE
131
132 .PP --noout
133
134 Do not
135 output the result.
136
137 .RE
138
139 .PP --novalid
140
141 Skip
142 loading the document's DTD.
143
144 .RE
145
146 .PP --nowrite
147
148
149 Refuses to
150 write to any file or
151 resource.
152
153 .RE
154
155 .PP -o or
156 --output FILE |
157 DIRECTORY
158
159
160 Direct
161 output to the given
162 FILE. Using the
163 option with a
164 DIRECTORY directs
165 the output files to
166 the specified
167 directory. This can
168 be useful for
169 multiple outputs
170 (also known as
171 "chunking") or
172 manpage processing.
173
174 .if n .sp
175 Important
176 The
177 given directory
178 must already
179 exist.
180
181 .sp
182 .5v
183 .if n .sp
184 Note
185 Make
186 sure that FILE
187 and DIRECTORY
188 follow the “URI
189 reference
190 computation” as
191 described in
192 RFC 2396 and
193 laters. This
194 means, that
195 e.g. -o
196 directory will
197 maybe not work,
198 but -o
199 directory/
200 will.
201
202 .sp
203 .5v
204 .RE
205
206 .PP
207 --encoding ENCODING
208
209
210 Allow
211 to specify the
212 encoding for
213 the input.
214
215
216 .RE
217 .PP
218 --param
219 PARAMNAME
220 PARAMVALUE
221
222
223 Pass
224 a parameter
225 of name
226 PARAMNAME
227 and value
228 PARAMVALUE
229 to the
230 stylesheet.
231 You may
232 pass
233 multiple
234 name/value
235 pairs up to
236 a maximum
237 of 32. If
238 the value
239 being
240 passed is a
241 string, you
242 can use
243 --stringparam
244 instead, to
245 avoid
246 additional
247 quote
248 characters
249 that appear
250 in string
251 expressions.
252 Note: the
253 XPath
254 expression
255 must be
256 UTF-8
257 encoded.
258
259
260 .RE
261
262 .PP
263 --path
264 "PATH(S)"
265
266
267
268 Use
269 the
270 (space-
271 or
272 colon-separated)
273 list of
274 filesystem
275 paths
276 specified
277 by
278 PATHS
279 to load
280 DTDs,
281 entities
282 or
283 documents.
284 Enclose
285 space-separated
286 lists
287 by
288 quotation
289 marks.
290
291
292 .RE
293
294 .PP
295 --profile
296 or
297 --norman
298
299
300
301 Output
302 profiling
303 information
304 detailing
305 the
306 amount
307 of
308 time
309 spent
310 in
311 each
312 part
313 of
314 the
315 stylesheet.
316 This
317 is
318 useful
319 in
320 optimizing
321 stylesheet
322 performance.
323
324
325 .RE
326
327 .PP
328 --repeat
329
330
331
332 Run
333 the
334 transformation
335 20
336 times.
337 Used
338 for
339 timing
340 tests.
341
342
343 .RE
344
345 .PP
346 --stringparam
347 PARAMNAME
348 PARAMVALUE
349
350
351
352 Pass
353 a
354 parameter
355 of
356 name
357 PARAMNAME
358 and
359 value
360 PARAMVALUE
361 where
362 PARAMVALUE
363 is
364 a
365 string
366 rather
367 than
368 a
369 node
370 identifier.
371 Note:
372 The
373 string
374 must
375 be
376 UTF-8
377 encoded.
378
379
380 .RE
381
382 .PP
383 --timing
384
385
386
387 Display
388 the
389 time
390 used
391 for
392 parsing
393 the
394 stylesheet,
395 parsing
396 the
397 document
398 and
399 applying
400 the
401 stylesheet
402 and
403 saving
404 the
405 result.
406 Displayed
407 in
408 milliseconds.
409
410
411 .RE
412
413 .PP
414 -v
415 or
416 --verbose
417
418
419
420 Output
421 each
422 step
423 taken
424 by
425 xsltproc
426 in
427 processing
428 the
429 stylesheet
430 and
431 the
432 document.
433
434
435 .RE
436
437 .PP
438 -V
439 or
440 --version
441
442
443
444 Show
445 the
446 version
447 of
448 libxml(3)
449 and
450 libxslt(3)
451 used.
452
453
454 .RE
455
456 .PP
457 --writesubtree
458 PATH
459
460
461
462 Allow
463 file
464 write
465 only
466 within
467 the
468 PATH
469 subtree.
470
471
472 .RE
473
474 .PP
475 --xinclude
476
477
478
479 Process
480 the
481 input
482 document
483 using
484 the
485 XInclude
486 specification.
487 More
488 details
489 on
490 this
491 can
492 be
493 found
494 in
495 the
496 XInclude
497 specification:
498 http://www.w3.org/TR/xinclude/
499
500
501 .RE
502
503
504
505
507
508
509
510 .PP SGML_CATALOG_FILES
511
512 SGML catalog behavior can be changed by
513 redirecting queries to the user's own set of catalogs. This can be
514 done by setting the SGML_CATALOG_FILES environment variable to a
515 list of catalogs. An empty one should deactivate loading the
516 default /etc/sgml/catalog catalog.
517
518 .RE
519
520 .PP XML_CATALOG_FILES
521
522 XML catalog behavior can be changed by
523 redirecting queries to the user's own set of catalogs. This can
524 be done by setting the XML_CATALOG_FILES environment variable
525 to a list of catalogs. An empty one should deactivate loading
526 the default /etc/xml/catalog catalog.
527
528 .RE
529
530
531
532
534 .PP xsltproc return codes provide information that can be
535 used when calling it from scripts.
536
537
538
539
540 .PP 0
541
542 No error (normal operation)
543
544 .RE
545
546 .PP 1
547
548 No argument
549
550 .RE
551
552 .PP 2
553
554 Too many parameters
555
556 .RE
557
558 .PP 3
559
560 Unknown option
561
562 .RE
563
564 .PP 4
565
566 Failed to parse the
567 stylesheet
568
569 .RE
570
571 .PP 5
572
573 Error in the stylesheet
574
575 .RE
576
577 .PP 6
578
579 Error in one of the
580 documents
581
582 .RE
583
584 .PP 7
585
586 Unsupported
587 xsl:output method
588
589 .RE
590
591 .PP 8
592
593 String
594 parameter contains both quote and
595 double-quotes
596
597 .RE
598
599 .PP 9
600
601 Internal
602 processing error
603
604 .RE
605
606 .PP 10
607
608
609 Processing was
610 stopped by a terminating
611 message
612
613 .RE
614
615 .PP 11
616
617
618 Could not
619 write the result to the
620 output file
621
622 .RE
623
624
625
626
628 .PP libxml(3), libxslt(3)
629
630 .PP More information can be found at
631
632 · libxml(3) web page http://www.xmlsoft.org/
633
634 .RE
635
636 · W3C XSLT page http://www.w3.org/TR/xslt
637
638 .RE
639
640
641
642
643
645 John Fleck <jfleck@inkstain.net>
646
647
648 Author.
649
651 Copyright © 2001, 2002
652
653
654
655libxslt $Date$ XSLTPROC(1)