1XSLTPROC(1) xsltproc Manual XSLTPROC(1)
2
3
4
6 xsltproc - command line XSLT processor
7
9 xsltproc [[-V | --version] [-v | --verbose] [{-o | --output} {FILE |
10 DIRECTORY}] | --timing | --repeat | --debug | --novalid |
11 --noout | --maxdepth VALUE | --maxvars VALUE |
12 --maxparserdepth VALUE | --huge | --seed-rand VALUE | --html |
13 --encoding ENCODING | --param PARAMNAME PARAMVALUE |
14 --stringparam PARAMNAME PARAMVALUE | --nonet |
15 --path "PATH(S)" | --load-trace | --catalogs | --xinclude |
16 --xincludestyle | [--profile | --norman] | --dumpextensions |
17 --nowrite | --nomkdir | --writesubtree PATH | --nodtdattr]
18 [STYLESHEET] {XML-FILE... | -}
19
21 xsltproc is a command line tool for applying XSLT stylesheets to XML
22 documents. It is part of libxslt(3), the XSLT C library for GNOME.
23 While it was developed as part of the GNOME project, it can operate
24 independently of the GNOME desktop.
25
26 xsltproc is invoked from the command line with the name of the
27 stylesheet to be used followed by the name of the file or files to
28 which the stylesheet is to be applied. It will use the standard input
29 if a filename provided is - .
30
31 If a stylesheet is included in an XML document with a Stylesheet
32 Processing Instruction, no stylesheet need to be named at the command
33 line. xsltproc will automatically detect the included stylesheet and
34 use it.
35
36 By default, output is to stdout. You can specify a file for output
37 using the -o or --output option.
38
40 xsltproc accepts the following options (in alphabetical order):
41
42 --catalogs
43 Use the SGML catalog specified in SGML_CATALOG_FILES to resolve the
44 location of external entities. By default, xsltproc looks for the
45 catalog specified in XML_CATALOG_FILES. If that is not specified,
46 it uses /etc/xml/catalog.
47
48 --debug
49 Output an XML tree of the transformed document for debugging
50 purposes.
51
52 --dumpextensions
53 Dumps the list of all registered extensions on stdout.
54
55 --html
56 The input document is an HTML file.
57
58 --load-trace
59 Display all the documents loaded during the processing to stderr.
60
61 --maxdepth VALUE
62 Adjust the maximum depth of the template stack before libxslt(3)
63 concludes it is in an infinite loop. The default is 3000.
64
65 --maxvars VALUE
66 Maximum number of variables. The default is 15000.
67
68 --maxparserdepth VALUE
69 Maximum element nesting level of parsed XML documents. The default
70 is 256.
71
72 --huge
73 Relax hardcoded limits of the XML parser by setting the
74 XML_PARSE_HUGE parser option.
75
76 --seed-rand VALUE
77 Initialize pseudo random number generator with specific seed.
78
79 --nodtdattr
80 Do not apply default attributes from the document's DTD.
81
82 --nomkdir
83 Refuses to create directories.
84
85 --nonet
86 Do not use the Internet to fetch DTDs, entities or documents.
87
88 --noout
89 Do not output the result.
90
91 --novalid
92 Skip loading the document's DTD.
93
94 --nowrite
95 Refuses to write to any file or resource.
96
97 -o or --output FILE | DIRECTORY
98 Direct output to the given FILE. Using the option with a DIRECTORY
99 directs the output files to the specified directory. This can be
100 useful for multiple outputs (also known as "chunking") or manpage
101 processing.
102
103 Important
104 The given directory must already exist.
105
106 Note
107 Make sure that FILE and DIRECTORY follow the “URI reference
108 computation” as described in RFC 2396 and laters. This means,
109 that e.g. -o directory will maybe not work, but -o directory/
110 will.
111
112 --encoding ENCODING
113 Allow to specify the encoding for the input.
114
115 --param PARAMNAME PARAMVALUE
116 Pass a parameter of name PARAMNAME and value PARAMVALUE to the
117 stylesheet. You may pass multiple name/value pairs up to a maximum
118 of 32. If the value being passed is a string, you can use
119 --stringparam instead, to avoid additional quote characters that
120 appear in string expressions. Note: the XPath expression must be
121 UTF-8 encoded.
122
123 --path "PATH(S)"
124 Use the (space- or colon-separated) list of filesystem paths
125 specified by PATHS to load DTDs, entities or documents. Enclose
126 space-separated lists by quotation marks.
127
128 --profile or --norman
129 Output profiling information detailing the amount of time spent in
130 each part of the stylesheet. This is useful in optimizing
131 stylesheet performance.
132
133 --repeat
134 Run the transformation 20 times. Used for timing tests.
135
136 --stringparam PARAMNAME PARAMVALUE
137 Pass a parameter of name PARAMNAME and value PARAMVALUE where
138 PARAMVALUE is a string rather than a node identifier. Note: The
139 string must be UTF-8 encoded.
140
141 --timing
142 Display the time used for parsing the stylesheet, parsing the
143 document and applying the stylesheet and saving the result.
144 Displayed in milliseconds.
145
146 -v or --verbose
147 Output each step taken by xsltproc in processing the stylesheet and
148 the document.
149
150 -V or --version
151 Show the version of libxml(3) and libxslt(3) used.
152
153 --writesubtree PATH
154 Allow file write only within the PATH subtree.
155
156 --xinclude
157 Process the input document using the XInclude specification. More
158 details on this can be found in the XInclude specification:
159 http://www.w3.org/TR/xinclude/
160
161 --xincludestyle
162 Process the stylesheet with XInclude.
163
165 SGML_CATALOG_FILES
166 SGML catalog behavior can be changed by redirecting queries to the
167 user's own set of catalogs. This can be done by setting the
168 SGML_CATALOG_FILES environment variable to a list of catalogs. An
169 empty one should deactivate loading the default /etc/sgml/catalog
170 catalog.
171
172 XML_CATALOG_FILES
173 XML catalog behavior can be changed by redirecting queries to the
174 user's own set of catalogs. This can be done by setting the
175 XML_CATALOG_FILES environment variable to a list of catalogs. An
176 empty one should deactivate loading the default /etc/xml/catalog
177 catalog.
178
180 xsltproc return codes provide information that can be used when calling
181 it from scripts.
182
183 0
184 No error (normal operation)
185
186 1
187 No argument
188
189 2
190 Too many parameters
191
192 3
193 Unknown option
194
195 4
196 Failed to parse the stylesheet
197
198 5
199 Error in the stylesheet
200
201 6
202 Error in one of the documents
203
204 7
205 Unsupported xsl:output method
206
207 8
208 String parameter contains both quote and double-quotes
209
210 9
211 Internal processing error
212
213 10
214 Processing was stopped by a terminating message
215
216 11
217 Could not write the result to the output file
218
220 libxml(3), libxslt(3)
221
222 More information can be found at
223
224 • libxml(3) web page https://gitlab.gnome.org/GNOME/libxslt
225
226 • W3C XSLT page http://www.w3.org/TR/xslt
227
228
230 John Fleck <jfleck@inkstain.net>
231 Author.
232
234 Copyright © 2001, 2002
235
236
237
238libxslt 08/17/2022 XSLTPROC(1)