set eol-style:native
[reactos.git] / reactos / lib / libxml2 / doc / xmllint.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "XMLLINT" 1 "" "" "xmllint Manual"
21 .SH NAME
22 xmllint \- command line XML tool
23 .SH "SYNOPSIS"
24 .ad l
25 .hy 0
26 .HP 8
27 \fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-shell\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ \fIpaths\fR\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fIfile\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-maxmem\ \fInbbytes\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fIencoding\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fIpatternvalue\fR\fR | \fB\-\-chkregister\fR | \fB\-\-relaxng\fR | \fB\-\-schema\fR | \fB\-\-c14n\fR] [\fB\fIxmlfile\fR\fR]
28 .ad
29 .hy
30
31 .SH "INTRODUCTION"
32
33 .PP
34 The xmllint program parses one or more XML files, specified on the command line as \fIxmlfile\fR (or the standard input if the filename provided is \- )\&. It prints various types of output, depending upon the options selected\&. It is useful for detecting errors both in XML code and in the XML parser itself\&.
35
36 .PP
37 It is included in libxml2\&.
38
39 .SH "OPTIONS"
40
41 .TP
42 \fB\-\-version\fR
43 Display the version of libxml2 used\&.
44
45 .TP
46 \fB\-\-debug\fR
47 Parse a file and output an annotated tree of the in\-memory version of the document\&.
48
49 .TP
50 \fB\-\-shell\fR
51 Run a navigating shell\&. Details on available commands in shell mode are below\&.
52
53 .TP
54 \fB\-\-debugent\fR
55 Debug the entities defined in the document\&.
56
57 .TP
58 \fB\-\-copy\fR
59 Test the internal copy implementation\&.
60
61 .TP
62 \fB\-\-recover\fR
63 Output any parsable portions of an invalid document\&.
64
65 .TP
66 \fB\-\-noent\fR
67 Substitute entity values for entity references\&. By default, xmllint leaves entity references in place\&.
68
69 .TP
70 \fB\-\-nocdata\fR
71 Substitute CDATA section by equivalent text nodes\&.
72
73 .TP
74 \fB\-\-nsclean\fR
75 Remove redundant namespace declarations\&.
76
77 .TP
78 \fB\-\-noout\fR
79 Suppress output\&. By default, xmllint outputs the result tree\&.
80
81 .TP
82 \fB\-\-nonet\fR
83 Do not use the Internet to fetch DTD's or entities\&.
84
85 .TP
86 \fB\-\-nonet\fR
87 Do not use the Internet to fetch DTD's or entities\&.
88
89 .TP
90 \fB\-\-path\fR \fIpaths\fR
91 Use the list (separated by space or column) of filesystem path specified by \fIpaths\fR to load DTDs or entities \&.
92
93 .TP
94 \fB\-\-load\-trace\fR
95 Display to stderr all the documents loaded during the processing\&.
96
97 .TP
98 \fB\-\-htmlout\fR
99 Output results as an HTML file\&. This causes xmllint to output the necessary HTML tags surrounding the result tree output so the results can be displayed in a browser\&.
100
101 .TP
102 \fB\-\-nowrap \fR
103 Do not output HTML doc wrapper\&.
104
105 .TP
106 \fB\-\-valid \fR
107 Determine if the document is a valid instance of the included Document Type Definition (DTD)\&. A DTD to be validated against also can be specified at the command line using the \fB\-\-dtdvalid\fR option\&. By default, xmllint also checks to determine if the document is well\-formed\&.
108
109 .TP
110 \fB\-\-postvalid\fR
111 Validate after parsing is completed\&.
112
113 .TP
114 \fB\-\-dtdvalid\fR \fIURL\fR
115 Use the DTD specified by \fIURL\fR for validation\&.
116
117 .TP
118 \fB\-\-dtdvalidfpi\fR \fIFPI\fR
119 Use the DTD specified by the Public Identifier \fIFPI\fR for validation, note that this will require a Catalog exporting that Public Identifier to work\&.
120
121 .TP
122 \fB\-\-timing\fR
123 Output information about the time it takes xmllint to perform the various steps\&.
124
125 .TP
126 \fB\-\-output\fR \fIfile\fR
127 Define a file path where xmllint will save the result of parsing\&. Usually the programs build a tree and save it on stdout, with this option the result XML instance will be saved onto a file\&.
128
129 .TP
130 \fB\-\-repeat\fR
131 Repeat 100 times, for timing or profiling\&.
132
133 .TP
134 \fB\-\-insert\fR
135 Test for valid insertions\&.
136
137 .TP
138 \fB\-\-compress\fR
139 Turn on gzip compression of output\&.
140
141 .TP
142 \fB\-\-html\fR
143 Use the HTML parser\&.
144
145 .TP
146 \fB\-\-xmlout\fR
147 Used in conjunction with \fB\-\-html\fR\&. Usually when HTML is parsed the document is saved with the HTML serializer, but with this option the resulting document is saved with the XML serializer\&. This is primarily used to generate XHTML from HTML input\&.
148
149 .TP
150 \fB\-\-push\fR
151 Use the push mode of the parser\&.
152
153 .TP
154 \fB\-\-memory\fR
155 Parse from memory\&.
156
157 .TP
158 \fB\-\-maxmem\fR \fInnbytes\fR
159 Test the parser memory support\&. \fInnbytes\fR is the maximum number of bytes the library is allowed to allocate\&. This can also be used to make sure batch processing of XML files will not exhaust the virtual memory of the server running them\&.
160
161 .TP
162 \fB\-\-nowarning\fR
163 Do not emit warnings from the parser and/or validator\&.
164
165 .TP
166 \fB\-\-noblanks\fR
167 Drop ignorable blank spaces\&.
168
169 .TP
170 \fB\-\-format\fR
171 Reformat and reindent the output\&. The $XMLLINT_INDENT environment variable controls the indentation (default value is two spaces " ")\&.
172
173 .TP
174 \fB\-\-testIO\fR
175 Test user input/output support\&.
176
177 .TP
178 \fB\-\-encode\fR \fIencoding\fR
179 Output in the given encoding\&.
180
181 .TP
182 \fB\-\-catalogs\fR
183 Use the catalogs from $SGML_CATALOG_FILES\&. Otherwise /etc/xml/catalog is used by default\&.
184
185 .TP
186 \fB\-\-nocatalogs\fR
187 Do not use any catalogs\&.
188
189 .TP
190 \fB\-\-auto\fR
191 Generate a small document for testing purposes\&.
192
193 .TP
194 \fB\-\-xinclude\fR
195 Do XInclude processing\&.
196
197 .TP
198 \fB\-\-noxincludenode\fR
199 Do XInclude processing but do not generate XInclude start and end nodes\&.
200
201 .TP
202 \fB\-\-loaddtd\fR
203 Fetch external DTD\&.
204
205 .TP
206 \fB\-\-dtdattr\fR
207 Fetch external DTD and populate the tree with inherited attributes\&.
208
209 .TP
210 \fB\-\-dropdtd\fR
211 Remove DTD from output\&.
212
213 .TP
214 \fB\-\-stream\fR
215 Use streaming API \- useful when used in combination with \-\-relaxng or \-\-valid options for validation of files that are too large to be held in memory\&.
216
217 .TP
218 \fB\-\-walker\fR
219 Test the walker module, which is a reader interface but for a document tree, instead of using the reader API on an unparsed document it works on a existing in\-memory tree\&. Used in debugging\&.
220
221 .TP
222 \fB\-\-chkregister\fR
223 Turn on node registration\&. Useful for developers testing libxml2 node tracking code\&.
224
225 .TP
226 \fB\-\-pattern\fR \fIpatternvalue\fR
227 Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser\&. It allows to select some nodes in the document based on an XPath (subset) expression\&. Used for debugging\&.
228
229 .TP
230 \fB\-\-relaxng\fR \fIschema\fR
231 Use RelaxNG file named \fIschema\fR for validation\&.
232
233 .TP
234 \fB\-\-schema\fR \fIschema\fR
235 Use a W3C XML Schema file named \fIschema\fR for validation\&.
236
237 .TP
238 \fB\-\-c14n\fR
239 Use the W3C XML Canonicalisation (C14N) to serialize the result of parsing to stdout\&. It keeps comments in the result\&.
240
241 .SH "SHELL"
242
243 .PP
244 xmllint offers an interactive shell mode invoked with the \fB\-\-shell\fR command\&. Available commands in shell mode include:
245
246 .TP
247 \fBbase\fR
248 display XML base of the node
249
250 .TP
251 \fBbye\fR
252 leave shell
253
254 .TP
255 \fBcat \fInode\fR\fR
256 Display node if given or current node\&.
257
258 .TP
259 \fBcd \fIpath\fR\fR
260 Change the current node to \fIpath\fR (if given and unique) or root if no argument given\&.
261
262 .TP
263 \fBdir \fIpath\fR\fR
264 Dumps information about the node (namespace, attributes, content)\&.
265
266 .TP
267 \fBdu \fIpath\fR\fR
268 Show the structure of the subtree under path or the current node\&.
269
270 .TP
271 \fBexit\fR
272 Leave the shell\&.
273
274 .TP
275 \fBhelp\fR
276 Show this help\&.
277
278 .TP
279 \fBfree\fR
280 Display memory usage\&.
281
282 .TP
283 \fBload \fIname\fR\fR
284 Load a new document with the given name\&.
285
286 .TP
287 \fBls \fIpath\fR\fR
288 List contents of \fIpath\fR (if given) or the current directory\&.
289
290 .TP
291 \fBpwd\fR
292 Display the path to the current node\&.
293
294 .TP
295 \fBquit\fR
296 Leave the shell\&.
297
298 .TP
299 \fBsave \fIname\fR\fR
300 Saves the current document to \fIname\fR if given or to the original name\&.
301
302 .TP
303 \fBvalidate\fR
304 Check the document for error\&.
305
306 .TP
307 \fBwrite \fIname\fR\fR
308 Write the current node to the given filename\&.
309
310 .SH "CATALOGS"
311
312 .PP
313 Catalog behavior can be changed by redirecting queries to the user's own set of catalogs\&. This can be done by setting the \fIXML_CATALOG_FILES\fR environment variable to a list of catalogs\&. An empty one should deactivate loading the default \fI/etc/xml/catalog\fR default catalog\&.
314
315 .SH "DEBUGGING CATALOGS"
316
317 .PP
318 Setting the environment variable \fIXML_DEBUG_CATALOG\fR using the command \fB"export XML_DEBUG_CATALOG="\fR outputs debugging information related to catalog operations\&.
319
320 .SH "ERROR RETURN CODES"
321
322 .PP
323 On the completion of execution, Xmllint returns the following error codes:
324
325 .TP
326 0
327 No error
328
329 .TP
330 1
331 Unclassified
332
333 .TP
334 2
335 Error in DTD
336
337 .TP
338 3
339 Validation error
340
341 .TP
342 4
343 Validation error
344
345 .TP
346 5
347 Error in schema compilation
348
349 .TP
350 6
351 Error writing output
352
353 .TP
354 7
355 Error in pattern (generated when [\-\-pattern] option is used)
356
357 .TP
358 8
359 Error in Reader registration (generated when [\-\-chkregister] option is used)
360
361 .TP
362 9
363 Out of memory error
364
365 .SH AUTHORS
366 John Fleck, Ziying Sherwin, Heiko Rupp.