blob: 1008179b8440d80fb6b09a44dbdd5aeb26f93e6b [file] [log] [blame]
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +00001<?xml version="1.0"?>
Daniel Veillardfd583412003-04-25 13:22:10 +00002<?xml-stylesheet type="text/xsl"
3 href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +00004<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
5 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
Daniel Veillard6464d6a2006-02-19 21:35:39 +00006
7 <!ENTITY xmllint "<command>xmllint</command>">
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +00008]>
Daniel Veillard46f97212006-02-20 08:58:51 +00009
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000010<refentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000011
Daniel Veillard46f97212006-02-20 08:58:51 +000012<refentryinfo>
13 <title>xmllint Manual</title>
14 <productname>libxml2</productname>
15 <copyright>
16 <year>2001</year>
17 <year>2004</year>
18 </copyright>
19 <authorgroup>
20 <author>
21 <firstname>John</firstname>
22 <surname>Fleck</surname>
23 <affiliation>
24 <address>
25 <email>jfleck@inkstain.net</email>
26 </address>
27 </affiliation>
28 </author>
29 <author>
30 <firstname>Ziying</firstname>
31 <surname>Sherwin</surname>
32 <affiliation>
33 <address>
34 <email>sherwin@nlm.nih.gov</email>
35 </address>
36 </affiliation>
37 </author>
38 <author>
39 <firstname>Heiko</firstname>
40 <surname>Rupp</surname>
41 <affiliation>
42 <address>
43 <email>hwr@pilhuhn.de</email>
44 </address>
45 </affiliation>
46 </author>
47 </authorgroup>
Daniel Veillard46f97212006-02-20 08:58:51 +000048 <!-- date should be the date of the latest change or the release version -->
Daniel Veillardad211982006-08-21 08:34:11 +000049 <date>$Date$</date>
Daniel Veillardbf95fd22006-04-06 08:22:51 +000050 <!-- still a bit buggy output, will talk to docbook-xsl upstream to fix this -->
51 <!-- <releaseinfo>This is release 0.5 of the xmllint Manual.</releaseinfo> -->
52 <!-- <edition>0.5</edition> -->
Daniel Veillard46f97212006-02-20 08:58:51 +000053</refentryinfo>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000054
Daniel Veillard46f97212006-02-20 08:58:51 +000055<refmeta>
56 <refentrytitle>xmllint</refentrytitle>
57 <manvolnum>1</manvolnum>
58</refmeta>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000059
Daniel Veillard46f97212006-02-20 08:58:51 +000060<refnamediv>
61 <refname>xmllint</refname>
62 <refpurpose>command line <acronym>XML</acronym> tool</refpurpose>
63</refnamediv>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000064
Daniel Veillard46f97212006-02-20 08:58:51 +000065<refsynopsisdiv>
Daniel Veillard51698c72006-04-06 14:02:42 +000066 <cmdsynopsis>
Daniel Veillard46f97212006-02-20 08:58:51 +000067 <command>xmllint</command>
68 <group choice="opt">
69 <arg choice="plain"><option>--version</option></arg>
70 <arg choice="plain"><option>--debug</option></arg>
71 <arg choice="plain"><option>--shell</option></arg>
Daniel Veillard113384f2013-03-27 11:43:41 +080072 <arg choice="plain"><option>--xpath "<replaceable class="option">XPath_expression</replaceable>"</option></arg>
Daniel Veillard46f97212006-02-20 08:58:51 +000073 <arg choice="plain"><option>--debugent</option></arg>
74 <arg choice="plain"><option>--copy</option></arg>
75 <arg choice="plain"><option>--recover</option></arg>
76 <arg choice="plain"><option>--noent</option></arg>
77 <arg choice="plain"><option>--noout</option></arg>
78 <arg choice="plain"><option>--nonet</option></arg>
Daniel Veillardbf95fd22006-04-06 08:22:51 +000079 <arg choice="plain"><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></arg>
Daniel Veillard46f97212006-02-20 08:58:51 +000080 <arg choice="plain"><option>--load-trace</option></arg>
81 <arg choice="plain"><option>--htmlout</option></arg>
82 <arg choice="plain"><option>--nowrap</option></arg>
83 <arg choice="plain"><option>--valid</option></arg>
84 <arg choice="plain"><option>--postvalid</option></arg>
85 <arg choice="plain"><option>--dtdvalid <replaceable class="option">URL</replaceable></option></arg>
86 <arg choice="plain"><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></arg>
87 <arg choice="plain"><option>--timing</option></arg>
88 <arg choice="plain"><option>--output <replaceable class="option">FILE</replaceable></option></arg>
89 <arg choice="plain"><option>--repeat</option></arg>
90 <arg choice="plain"><option>--insert</option></arg>
91 <arg choice="plain"><option>--compress</option></arg>
92 <arg choice="plain"><option>--html</option></arg>
93 <arg choice="plain"><option>--xmlout</option></arg>
94 <arg choice="plain"><option>--push</option></arg>
95 <arg choice="plain"><option>--memory</option></arg>
96 <arg choice="plain"><option>--maxmem <replaceable class="option">NBBYTES</replaceable></option></arg>
97 <arg choice="plain"><option>--nowarning</option></arg>
98 <arg choice="plain"><option>--noblanks</option></arg>
99 <arg choice="plain"><option>--nocdata</option></arg>
100 <arg choice="plain"><option>--format</option></arg>
101 <arg choice="plain"><option>--encode <replaceable class="option">ENCODING</replaceable></option></arg>
102 <arg choice="plain"><option>--dropdtd</option></arg>
103 <arg choice="plain"><option>--nsclean</option></arg>
104 <arg choice="plain"><option>--testIO</option></arg>
105 <arg choice="plain"><option>--catalogs</option></arg>
106 <arg choice="plain"><option>--nocatalogs</option></arg>
107 <arg choice="plain"><option>--auto</option></arg>
108 <arg choice="plain"><option>--xinclude</option></arg>
109 <arg choice="plain"><option>--noxincludenode</option></arg>
110 <arg choice="plain"><option>--loaddtd</option></arg>
111 <arg choice="plain"><option>--dtdattr</option></arg>
112 <arg choice="plain"><option>--stream</option></arg>
113 <arg choice="plain"><option>--walker</option></arg>
114 <arg choice="plain"><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></arg>
115 <arg choice="plain"><option>--chkregister</option></arg>
116 <arg choice="plain"><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></arg>
117 <arg choice="plain"><option>--schema <replaceable class="option">SCHEMA</replaceable></option></arg>
118 <arg choice="plain"><option>--c14n</option></arg>
119 </group>
120 <group choice="req">
121 <arg choice="plain" rep="repeat"><replaceable>XML-FILE(S)</replaceable></arg>
122 <arg choice="plain" rep="norepeat">-</arg>
123 </group>
124 </cmdsynopsis>
Daniel Veillard51698c72006-04-06 14:02:42 +0000125 <cmdsynopsis>
Daniel Veillard46f97212006-02-20 08:58:51 +0000126 <command>xmllint</command>
127 <arg choice="plain"><option>--help</option></arg>
128 </cmdsynopsis>
129</refsynopsisdiv>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000130
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000131<refsect1 id="description">
Daniel Veillard46f97212006-02-20 08:58:51 +0000132 <title>DESCRIPTION</title>
133 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000134 The &xmllint; program parses one or more <acronym>XML</acronym> files,
135 specified on the command line as <replaceable>XML-FILE</replaceable>
136 (or the standard input if the filename provided
137 is <emphasis role="bold">-</emphasis> ). It prints various types of
138 output, depending upon the options selected. It is useful for detecting
139 errors both in <acronym>XML</acronym> code and in
140 the <acronym>XML</acronym> parser itself.
Daniel Veillard46f97212006-02-20 08:58:51 +0000141 </para>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000142 <para>&xmllint; is included in <citerefentry>
143 <refentrytitle>libxml</refentrytitle>
144 <manvolnum>3</manvolnum>
145 </citerefentry>.</para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000146</refsect1>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000147
Daniel Veillard46f97212006-02-20 08:58:51 +0000148<refsect1 id="options">
149 <title>OPTIONS</title>
150 <para>
151 &xmllint; accepts the following options (in alphabetical order):
152 </para>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000153
Daniel Veillard46f97212006-02-20 08:58:51 +0000154 <variablelist>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000155
Daniel Veillard46f97212006-02-20 08:58:51 +0000156 <varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000157 <term><option>--auto</option></term>
158 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000159 <para>Generate a small document for testing purposes.</para>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000160 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000161 </varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000162
Daniel Veillard46f97212006-02-20 08:58:51 +0000163 <varlistentry>
164 <term><option>--catalogs</option></term>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000165 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000166 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000167 Use the <acronym>SGML</acronym> catalog(s) from <envar>SGML_CATALOG_FILES</envar>.
168 Otherwise <acronym>XML</acronym> catalogs starting
169 from <filename>/etc/xml/catalog</filename> are used by default.
Daniel Veillard46f97212006-02-20 08:58:51 +0000170 </para>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000171 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000172 </varlistentry>
173
174 <varlistentry>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000175 <term><option>--chkregister</option></term>
176 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000177 <para>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000178 Turn on node registration. Useful for developers testing <citerefentry>
179 <refentrytitle>libxml</refentrytitle>
180 <manvolnum>3</manvolnum>
181 </citerefentry> node tracking code.
Daniel Veillard46f97212006-02-20 08:58:51 +0000182 </para>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000183 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000184 </varlistentry>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000185
Daniel Veillard46f97212006-02-20 08:58:51 +0000186 <varlistentry>
187 <term><option>--compress</option></term>
188 <listitem>
189 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000190 Turn on <citerefentry>
191 <refentrytitle>gzip</refentrytitle>
192 <manvolnum>1</manvolnum>
193 </citerefentry> compression of output.
Daniel Veillard46f97212006-02-20 08:58:51 +0000194 </para>
195 </listitem>
196 </varlistentry>
197
198 <varlistentry>
199 <term><option>--copy</option></term>
200 <listitem>
201 <para>Test the internal copy implementation.</para>
202 </listitem>
203 </varlistentry>
204
205 <varlistentry>
206 <term><option>--c14n</option></term>
207 <listitem>
208 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000209 Use the W3C <acronym>XML</acronym> Canonicalisation (<acronym>C14N</acronym>) to
210 serialize the result of parsing to <filename class="devicefile">stdout</filename>.
Daniel Veillard46f97212006-02-20 08:58:51 +0000211 It keeps comments in the result.
212 </para>
213 </listitem>
214 </varlistentry>
215
216 <varlistentry>
217 <term><option>--dtdvalid <replaceable class="option">URL</replaceable></option></term>
218 <listitem>
219 <para>
220 Use the <acronym>DTD</acronym> specified by
221 an <replaceable>URL</replaceable> for validation.
222 </para>
223 </listitem>
224 </varlistentry>
225
226 <varlistentry>
227 <term><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></term>
228 <listitem>
229 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000230 Use the <acronym>DTD</acronym> specified by a Formal Public
Daniel Veillard46f97212006-02-20 08:58:51 +0000231 Identifier <replaceable>FPI</replaceable> for validation, note that this
Daniel Veillardad211982006-08-21 08:34:11 +0000232 will require a catalog exporting that Formal Public Identifier to work.
Daniel Veillard46f97212006-02-20 08:58:51 +0000233 </para>
234 </listitem>
235 </varlistentry>
236
237 <varlistentry>
238 <term><option>--debug</option></term>
239 <listitem>
240 <para>
241 Parse a file and output an annotated tree of the
242 in-memory version of the document.
243 </para>
244 </listitem>
245 </varlistentry>
246
247 <varlistentry>
248 <term><option>--debugent</option></term>
249 <listitem>
250 <para>Debug the entities defined in the document.</para>
251 </listitem>
252 </varlistentry>
253
254 <varlistentry>
255 <term><option>--dropdtd</option></term>
256 <listitem>
257 <para>Remove <acronym>DTD</acronym> from output.</para>
258 </listitem>
259 </varlistentry>
260
261 <varlistentry>
262 <term><option>--dtdattr</option></term>
263 <listitem>
264 <para>
265 Fetch external <acronym>DTD</acronym> and populate the tree with
266 inherited attributes.
267 </para>
268 </listitem>
269 </varlistentry>
270
271 <varlistentry>
272 <term><option>--encode <replaceable class="option">ENCODING</replaceable></option></term>
273 <listitem>
Daniel Veillarde59c2442013-12-11 00:01:38 +0800274 <para>Output in the given encoding. Note that this works for full document not fragments or result from XPath queries.</para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000275 </listitem>
276 </varlistentry>
277
278 <varlistentry>
279 <term><option>--format</option></term>
280 <listitem>
281 <para>
282 Reformat and reindent the output. The <envar>XMLLINT_INDENT</envar>
Daniel Veillardad211982006-08-21 08:34:11 +0000283 environment variable controls the indentation. The default value is two
Daniel Veillard46f97212006-02-20 08:58:51 +0000284 spaces &quot; &quot;).
285 </para>
286 </listitem>
287 </varlistentry>
288
289 <varlistentry>
290 <term><option>--help</option></term>
291 <listitem>
292 <para>Print out a short usage summary for &xmllint;.</para>
293 </listitem>
294 </varlistentry>
295
296 <varlistentry>
297 <term><option>--html</option></term>
298 <listitem>
299 <para>Use the <acronym>HTML</acronym> parser.</para>
300 </listitem>
301 </varlistentry>
302
303 <varlistentry>
304 <term><option>--htmlout</option></term>
305 <listitem>
306 <para>
307 Output results as an <acronym>HTML</acronym> file. This
308 causes &xmllint; to output the necessary <acronym>HTML</acronym>
309 tags surrounding the result tree output so the results can be
310 displayed/viewed in a browser.
311 </para>
312 </listitem>
313 </varlistentry>
314
315 <varlistentry>
316 <term><option>--insert</option></term>
317 <listitem>
318 <para>Test for valid insertions.</para>
319 </listitem>
320 </varlistentry>
321
322 <varlistentry>
323 <term><option>--loaddtd</option></term>
324 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000325 <para>Fetch an external <acronym>DTD</acronym>.</para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000326 </listitem>
327 </varlistentry>
328
329 <varlistentry>
330 <term><option>--load-trace</option></term>
331 <listitem>
332 <para>
333 Display all the documents loaded during the processing
334 to <filename class="devicefile">stderr</filename>.
335 </para>
336 </listitem>
337 </varlistentry>
338
339 <varlistentry>
340 <term><option>--maxmem <replaceable class="option">NNBYTES</replaceable></option></term>
341 <listitem>
342 <para>
343 Test the parser memory support. <replaceable>NNBYTES</replaceable>
344 is the maximum number of bytes the library is allowed to allocate.
345 This can also be used to make sure batch processing
346 of <acronym>XML</acronym> files will not exhaust the virtual memory
347 of the server running them.
348 </para>
349 </listitem>
350 </varlistentry>
351
352 <varlistentry>
353 <term><option>--memory</option></term>
354 <listitem>
355 <para>Parse from memory.</para>
356 </listitem>
357 </varlistentry>
358
359 <varlistentry>
360 <term><option>--noblanks</option></term>
361 <listitem>
362 <para>Drop ignorable blank spaces.</para>
363 </listitem>
364 </varlistentry>
365
366 <varlistentry>
367 <term><option>--nocatalogs</option></term>
368 <listitem>
369 <para>Do not use any catalogs.</para>
370 </listitem>
371 </varlistentry>
372
373 <varlistentry>
374 <term><option>--nocdata</option></term>
375 <listitem>
376 <para>Substitute CDATA section by equivalent text nodes.</para>
377 </listitem>
378 </varlistentry>
379
380 <varlistentry>
381 <term><option>--noent</option></term>
382 <listitem>
383 <para>
384 Substitute entity values for entity references. By default, &xmllint;
385 leaves entity references in place.
386 </para>
387 </listitem>
388 </varlistentry>
389
390 <varlistentry>
391 <term><option>--nonet</option></term>
392 <listitem>
393 <para>
394 Do not use the Internet to fetch <acronym>DTD</acronym>s or entities.
395 </para>
396 </listitem>
397 </varlistentry>
398
399 <varlistentry>
400 <term><option>--noout</option></term>
401 <listitem>
402 <para>
403 Suppress output. By default, &xmllint; outputs the result tree.
404 </para>
405 </listitem>
406 </varlistentry>
407
408 <varlistentry>
409 <term><option>--nowarning</option></term>
410 <listitem>
411 <para>Do not emit warnings from the parser and/or validator.</para>
412 </listitem>
413 </varlistentry>
414
415 <varlistentry>
416 <term><option>--nowrap</option></term>
417 <listitem>
418 <para>Do not output <acronym>HTML</acronym> doc wrapper.</para>
419 </listitem>
420 </varlistentry>
421
422 <varlistentry>
423 <term><option>--noxincludenode</option></term>
424 <listitem>
425 <para>
426 Do XInclude processing but do not generate XInclude start and end nodes.
427 </para>
428 </listitem>
429 </varlistentry>
430
431 <varlistentry>
432 <term><option>--nsclean</option></term>
433 <listitem>
434 <para>Remove redundant namespace declarations.</para>
435 </listitem>
436 </varlistentry>
437
438 <varlistentry>
439 <term><option>--output <replaceable class="option">FILE</replaceable></option></term>
440 <listitem>
441 <para>
442 Define a file path where &xmllint; will save the result of parsing.
443 Usually the programs build a tree and save it
444 on <filename class="devicefile">stdout</filename>, with this option
445 the result <acronym>XML</acronym> instance will be saved onto a file.
446 </para>
447 </listitem>
448 </varlistentry>
449
450 <varlistentry>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000451 <term><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></term>
Daniel Veillard46f97212006-02-20 08:58:51 +0000452 <listitem>
453 <para>
454 Use the (space- or colon-separated) list of filesystem paths specified
455 by <replaceable>PATHS</replaceable> to load <acronym>DTD</acronym>s or
456 entities. Enclose space-separated lists by quotation marks.
457 </para>
458 </listitem>
459 </varlistentry>
460
461 <varlistentry>
462 <term><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></term>
463 <listitem>
464 <para>
465 Used to exercise the pattern recognition engine, which can be used
466 with the reader interface to the parser. It allows to select some
467 nodes in the document based on an XPath (subset) expression. Used
468 for debugging.
469 </para>
470 </listitem>
471 </varlistentry>
472
473 <varlistentry>
474 <term><option>--postvalid</option></term>
475 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000476 <para>Validate after parsing has completed.</para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000477 </listitem>
478 </varlistentry>
479
480 <varlistentry>
481 <term><option>--push</option></term>
482 <listitem>
483 <para>Use the push mode of the parser.</para>
484 </listitem>
485 </varlistentry>
486
487 <varlistentry>
488 <term><option>--recover</option></term>
489 <listitem>
490 <para>Output any parsable portions of an invalid document.</para>
491 </listitem>
492 </varlistentry>
493
494 <varlistentry>
495 <term><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></term>
496 <listitem>
497 <para>
498 Use RelaxNG file named <replaceable class="option">SCHEMA</replaceable>
499 for validation.
500 </para>
501 </listitem>
502 </varlistentry>
503
504 <varlistentry>
505 <term><option>--repeat</option></term>
506 <listitem>
507 <para>Repeat 100 times, for timing or profiling.</para>
508 </listitem>
509 </varlistentry>
510
511 <varlistentry>
512 <term><option>--schema <replaceable>SCHEMA</replaceable></option></term>
513 <listitem>
514 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000515 Use a W3C <acronym>XML</acronym> Schema file
516 named <replaceable>SCHEMA</replaceable> for validation.
Daniel Veillard46f97212006-02-20 08:58:51 +0000517 </para>
518 </listitem>
519 </varlistentry>
520
521 <varlistentry>
522 <term><option>--shell</option></term>
523 <listitem>
524 <para>
525 Run a navigating shell. Details on available commands in shell mode
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000526 are below (see <xref linkend="shell"/>).
Daniel Veillard46f97212006-02-20 08:58:51 +0000527 </para>
528 </listitem>
529 </varlistentry>
530
531 <varlistentry>
Daniel Veillard113384f2013-03-27 11:43:41 +0800532 <term><option>--xpath "<replaceable class="option">XPath_expression</replaceable>"</option></term>
533 <listitem>
534 <para>
535 Run an XPath expression given as argument and print the
536 result. In case of a nodeset result, each node in the
537 node set is serialized in full in the output. In case
538 of an empty node set the "XPath set is empty" result
539 will be shown and an error exit code will be returned.
540 </para>
541 </listitem>
542 </varlistentry>
543
544 <varlistentry>
Daniel Veillard46f97212006-02-20 08:58:51 +0000545 <term><option>--stream</option></term>
546 <listitem>
547 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000548 Use streaming <acronym>API</acronym> - useful when used in combination
Daniel Veillard46f97212006-02-20 08:58:51 +0000549 with <option>--relaxng</option> or <option>--valid</option> options
550 for validation of files that are too large to be held in memory.
551 </para>
552 </listitem>
553 </varlistentry>
554
555 <varlistentry>
556 <term><option>--testIO</option></term>
557 <listitem>
558 <para>Test user input/output support.</para>
559 </listitem>
560 </varlistentry>
561
562 <varlistentry>
563 <term><option>--timing</option></term>
564 <listitem>
565 <para>
566 Output information about the time it takes &xmllint; to perform the
567 various steps.
568 </para>
569 </listitem>
570 </varlistentry>
571
572 <varlistentry>
573 <term><option>--valid</option></term>
574 <listitem>
575 <para>
576 Determine if the document is a valid instance of the included
577 Document Type Definition (<acronym>DTD</acronym>).
578 A <acronym>DTD</acronym> to be validated against also can be
579 specified at the command line using the <option>--dtdvalid</option>
580 option. By default, &xmllint; also checks to determine if the
581 document is well-formed.
582 </para>
583 </listitem>
584 </varlistentry>
585
586 <varlistentry>
587 <term><option>--version</option></term>
588 <listitem>
589 <para>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000590 Display the version of <citerefentry>
591 <refentrytitle>libxml</refentrytitle>
592 <manvolnum>3</manvolnum>
593 </citerefentry> used.
Daniel Veillard46f97212006-02-20 08:58:51 +0000594 </para>
595 </listitem>
596 </varlistentry>
597
598 <varlistentry>
599 <term><option>--walker</option></term>
600 <listitem>
601 <para>
602 Test the walker module, which is a reader interface but for a
603 document tree, instead of using the reader <acronym>API</acronym> on
Daniel Veillardad211982006-08-21 08:34:11 +0000604 an unparsed document it works on an existing in-memory tree. Used for
Daniel Veillard46f97212006-02-20 08:58:51 +0000605 debugging.
606 </para>
607 </listitem>
608 </varlistentry>
609
610 <varlistentry>
611 <term><option>--xinclude</option></term>
612 <listitem>
613 <para>Do XInclude processing.</para>
614 </listitem>
615 </varlistentry>
616
617 <varlistentry>
618 <term><option>--xmlout</option></term>
619 <listitem>
620 <para>
621 Used in conjunction with <option>--html</option>. Usually
622 when <acronym>HTML</acronym> is parsed the document is saved with
Daniel Veillardad211982006-08-21 08:34:11 +0000623 the <acronym>HTML</acronym> serializer. But with this option the
Daniel Veillard46f97212006-02-20 08:58:51 +0000624 resulting document is saved with the <acronym>XML</acronym>
625 serializer. This is primarily used to
Daniel Veillardad211982006-08-21 08:34:11 +0000626 generate <acronym>XHTML</acronym> from <acronym>HTML</acronym> input.
Daniel Veillard46f97212006-02-20 08:58:51 +0000627 </para>
628 </listitem>
629 </varlistentry>
630
631 </variablelist>
632</refsect1>
633
634<refsect1 id="shell">
635 <title>SHELL COMMANDS</title>
636 <para>
637 &xmllint; offers an interactive shell mode invoked with
638 the <option>--shell</option> command. Available commands in shell mode
639 include (in alphabetical order):
640 </para>
641 <variablelist>
642
643 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000644 <term><command>base</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000645 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000646 <para>Display <acronym>XML</acronym> base of the node.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000647 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000648 </varlistentry>
649
650 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000651 <term><command>bye</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000652 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000653 <para>Leave the shell.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000654 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000655 </varlistentry>
656
657 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000658 <term><command>cat <replaceable>NODE</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000659 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000660 <para>Display the given node or the current one.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000661 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000662 </varlistentry>
663
664 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000665 <term><command>cd <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000666 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000667 <para>
668 Change the current node to the given path (if unique) or root if no
669 argument is given.
670 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000671 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000672 </varlistentry>
673
674 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000675 <term><command>dir <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000676 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000677 <para>
678 Dumps information about the node (namespace, attributes, content).
679 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000680 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000681 </varlistentry>
682
683 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000684 <term><command>du <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000685 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000686 <para>
687 Show the structure of the subtree under the given path or the current node.
688 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000689 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000690 </varlistentry>
691
692 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000693 <term><command>exit</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000694 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000695 <para>Leave the shell.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000696 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000697 </varlistentry>
698
699 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000700 <term><command>help</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000701 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000702 <para>Show this help.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000703 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000704 </varlistentry>
705
706 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000707 <term><command>free</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000708 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000709 <para>Display memory usage.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000710 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000711 </varlistentry>
712
713 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000714 <term><command>load <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000715 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000716 <para>Load a new document with the given filename.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000717 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000718 </varlistentry>
719
720 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000721 <term><command>ls <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000722 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000723 <para>List contents of the given path or the current directory.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000724 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000725 </varlistentry>
726
727 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000728 <term><command>pwd</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000729 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000730 <para>Display the path to the current node.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000731 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000732 </varlistentry>
733
734 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000735 <term><command>quit</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000736 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000737 <para>Leave the shell.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000738 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000739 </varlistentry>
740
741 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000742 <term><command>save <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000743 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000744 <para>
745 Save the current document to the given filename or to the original name.
746 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000747 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000748 </varlistentry>
749
750 <varlistentry>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000751 <term><option>validate</option></term>
752 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000753 <para>Check the document for errors.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000754 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000755 </varlistentry>
756
757 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000758 <term><command>write <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000759 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000760 <para>Write the current node to the given filename.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000761 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000762 </varlistentry>
763
764 </variablelist>
765</refsect1>
766
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000767<refsect1 id="environment">
Daniel Veillard46f97212006-02-20 08:58:51 +0000768 <title>ENVIRONMENT</title>
769 <variablelist>
770
771 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000772 <term><envar>SGML_CATALOG_FILES</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000773 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000774 <para><acronym>SGML</acronym> catalog behavior can be changed by redirecting
775 queries to the user's own set of catalogs. This can be done by setting
776 the <envar>SGML_CATALOG_FILES</envar> environment variable to a list
777 of catalogs. An empty one should deactivate loading the
778 default <filename>/etc/sgml/catalog</filename> catalog.
779 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000780 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000781 </varlistentry>
782
783 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000784 <term><envar>XML_CATALOG_FILES</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000785 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000786 <para><acronym>XML</acronym> catalog behavior can be changed by redirecting
787 queries to the user's own set of catalogs. This can be done by setting
Daniel Veillard46f97212006-02-20 08:58:51 +0000788 the <envar>XML_CATALOG_FILES</envar> environment variable to a list
789 of catalogs. An empty one should deactivate loading the
Daniel Veillardad211982006-08-21 08:34:11 +0000790 default <filename>/etc/xml/catalog</filename> catalog.
Daniel Veillard46f97212006-02-20 08:58:51 +0000791 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000792 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000793 </varlistentry>
794
795 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000796 <term><envar>XML_DEBUG_CATALOG</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000797 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000798 <para>Setting the environment variable <envar>XML_DEBUG_CATALOG</envar>
799 to <parameter>non-zero</parameter> using the <command>export</command>
800 command outputs debugging information related to catalog operations.
Daniel Veillard46f97212006-02-20 08:58:51 +0000801 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000802 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000803 </varlistentry>
804
805 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000806 <term><envar>XMLLINT_INDENT</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000807 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000808 <para>Setting the environment variable <envar>XMLLINT_INDENT</envar>
809 controls the indentation. The default value is two spaces &quot; &quot;.
810 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000811 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000812 </varlistentry>
813
814 </variablelist>
815</refsect1>
816
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000817<refsect1 id="diagnostics">
Daniel Veillard46f97212006-02-20 08:58:51 +0000818 <title>DIAGNOSTICS</title>
819 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000820 &xmllint; return codes provide information that can be used when
821 calling it from scripts.
Daniel Veillard46f97212006-02-20 08:58:51 +0000822 </para>
Daniel Veillard1589e8d2006-04-06 12:57:09 +0000823 <!-- better use segmentedlist element later,
824 which is currently only supported in snapshots -->
825 <variablelist>
826
827 <varlistentry>
828 <term><errorcode>0</errorcode></term>
829 <listitem>
830 <para>No error</para>
831 </listitem>
832 </varlistentry>
833
834 <varlistentry>
835 <term><errorcode>1</errorcode></term>
836 <listitem>
837 <para>Unclassified</para>
838 </listitem>
839 </varlistentry>
840
841 <varlistentry>
842 <term><errorcode>2</errorcode></term>
843 <listitem>
844 <para>Error in <acronym>DTD</acronym></para>
845 </listitem>
846 </varlistentry>
847
848 <varlistentry>
849 <term><errorcode>3</errorcode></term>
850 <listitem>
851 <para>Validation error</para>
852 </listitem>
853 </varlistentry>
854
855 <varlistentry>
856 <term><errorcode>4</errorcode></term>
857 <listitem>
858 <para>Validation error</para>
859 </listitem>
860 </varlistentry>
861
862 <varlistentry>
863 <term><errorcode>5</errorcode></term>
864 <listitem>
865 <para>Error in schema compilation</para>
866 </listitem>
867 </varlistentry>
868
869 <varlistentry>
870 <term><errorcode>6</errorcode></term>
871 <listitem>
872 <para>Error writing output</para>
873 </listitem>
874 </varlistentry>
875
876 <varlistentry>
877 <term><errorcode>7</errorcode></term>
878 <listitem>
879 <para>
880 Error in pattern (generated when <option>--pattern</option> option is used)
881 </para>
882 </listitem>
883 </varlistentry>
884
885 <varlistentry>
886 <term><errorcode>8</errorcode></term>
887 <listitem>
888 <para>
889 Error in Reader registration (generated
890 when <option>--chkregister</option> option is used)
891 </para>
892 </listitem>
893 </varlistentry>
894
895 <varlistentry>
896 <term><errorcode>9</errorcode></term>
897 <listitem>
898 <para>Out of memory error</para>
899 </listitem>
900 </varlistentry>
901
902 </variablelist>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000903</refsect1>
Daniel Veillard46f97212006-02-20 08:58:51 +0000904
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000905<refsect1 id="seealso">
906 <title>SEE ALSO</title>
Daniel Veillardad211982006-08-21 08:34:11 +0000907 <para><citerefentry>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000908 <refentrytitle>libxml</refentrytitle>
909 <manvolnum>3</manvolnum>
910 </citerefentry>
911 </para>
Daniel Veillardad211982006-08-21 08:34:11 +0000912 <para>
913 More information can be found at
914 <itemizedlist>
915 <listitem>
916 <para><citerefentry>
917 <refentrytitle>libxml</refentrytitle>
918 <manvolnum>3</manvolnum>
919 </citerefentry> web page <ulink url="http://www.xmlsoft.org/"/>
920 </para>
921 </listitem>
922 <listitem>
923 <para>W3C <acronym>XSLT</acronym> page <ulink url="http://www.w3.org/TR/xslt"/>
924 </para>
925 </listitem>
926 </itemizedlist>
927 </para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000928</refsect1>
929
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000930</refentry>