blob: 9a41b4e2b72333b080b3e09527153500925e050d [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>
72 <arg choice="plain"><option>--debugent</option></arg>
73 <arg choice="plain"><option>--copy</option></arg>
74 <arg choice="plain"><option>--recover</option></arg>
75 <arg choice="plain"><option>--noent</option></arg>
76 <arg choice="plain"><option>--noout</option></arg>
77 <arg choice="plain"><option>--nonet</option></arg>
Daniel Veillardbf95fd22006-04-06 08:22:51 +000078 <arg choice="plain"><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></arg>
Daniel Veillard46f97212006-02-20 08:58:51 +000079 <arg choice="plain"><option>--load-trace</option></arg>
80 <arg choice="plain"><option>--htmlout</option></arg>
81 <arg choice="plain"><option>--nowrap</option></arg>
82 <arg choice="plain"><option>--valid</option></arg>
83 <arg choice="plain"><option>--postvalid</option></arg>
84 <arg choice="plain"><option>--dtdvalid <replaceable class="option">URL</replaceable></option></arg>
85 <arg choice="plain"><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></arg>
86 <arg choice="plain"><option>--timing</option></arg>
87 <arg choice="plain"><option>--output <replaceable class="option">FILE</replaceable></option></arg>
88 <arg choice="plain"><option>--repeat</option></arg>
89 <arg choice="plain"><option>--insert</option></arg>
90 <arg choice="plain"><option>--compress</option></arg>
91 <arg choice="plain"><option>--html</option></arg>
92 <arg choice="plain"><option>--xmlout</option></arg>
93 <arg choice="plain"><option>--push</option></arg>
94 <arg choice="plain"><option>--memory</option></arg>
95 <arg choice="plain"><option>--maxmem <replaceable class="option">NBBYTES</replaceable></option></arg>
96 <arg choice="plain"><option>--nowarning</option></arg>
97 <arg choice="plain"><option>--noblanks</option></arg>
98 <arg choice="plain"><option>--nocdata</option></arg>
99 <arg choice="plain"><option>--format</option></arg>
100 <arg choice="plain"><option>--encode <replaceable class="option">ENCODING</replaceable></option></arg>
101 <arg choice="plain"><option>--dropdtd</option></arg>
102 <arg choice="plain"><option>--nsclean</option></arg>
103 <arg choice="plain"><option>--testIO</option></arg>
104 <arg choice="plain"><option>--catalogs</option></arg>
105 <arg choice="plain"><option>--nocatalogs</option></arg>
106 <arg choice="plain"><option>--auto</option></arg>
107 <arg choice="plain"><option>--xinclude</option></arg>
108 <arg choice="plain"><option>--noxincludenode</option></arg>
109 <arg choice="plain"><option>--loaddtd</option></arg>
110 <arg choice="plain"><option>--dtdattr</option></arg>
111 <arg choice="plain"><option>--stream</option></arg>
112 <arg choice="plain"><option>--walker</option></arg>
113 <arg choice="plain"><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></arg>
114 <arg choice="plain"><option>--chkregister</option></arg>
115 <arg choice="plain"><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></arg>
116 <arg choice="plain"><option>--schema <replaceable class="option">SCHEMA</replaceable></option></arg>
117 <arg choice="plain"><option>--c14n</option></arg>
118 </group>
119 <group choice="req">
120 <arg choice="plain" rep="repeat"><replaceable>XML-FILE(S)</replaceable></arg>
121 <arg choice="plain" rep="norepeat">-</arg>
122 </group>
123 </cmdsynopsis>
Daniel Veillard51698c72006-04-06 14:02:42 +0000124 <cmdsynopsis>
Daniel Veillard46f97212006-02-20 08:58:51 +0000125 <command>xmllint</command>
126 <arg choice="plain"><option>--help</option></arg>
127 </cmdsynopsis>
128</refsynopsisdiv>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000129
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000130<refsect1 id="description">
Daniel Veillard46f97212006-02-20 08:58:51 +0000131 <title>DESCRIPTION</title>
132 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000133 The &xmllint; program parses one or more <acronym>XML</acronym> files,
134 specified on the command line as <replaceable>XML-FILE</replaceable>
135 (or the standard input if the filename provided
136 is <emphasis role="bold">-</emphasis> ). It prints various types of
137 output, depending upon the options selected. It is useful for detecting
138 errors both in <acronym>XML</acronym> code and in
139 the <acronym>XML</acronym> parser itself.
Daniel Veillard46f97212006-02-20 08:58:51 +0000140 </para>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000141 <para>&xmllint; is included in <citerefentry>
142 <refentrytitle>libxml</refentrytitle>
143 <manvolnum>3</manvolnum>
144 </citerefentry>.</para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000145</refsect1>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000146
Daniel Veillard46f97212006-02-20 08:58:51 +0000147<refsect1 id="options">
148 <title>OPTIONS</title>
149 <para>
150 &xmllint; accepts the following options (in alphabetical order):
151 </para>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000152
Daniel Veillard46f97212006-02-20 08:58:51 +0000153 <variablelist>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000154
Daniel Veillard46f97212006-02-20 08:58:51 +0000155 <varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000156 <term><option>--auto</option></term>
157 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000158 <para>Generate a small document for testing purposes.</para>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000159 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000160 </varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000161
Daniel Veillard46f97212006-02-20 08:58:51 +0000162 <varlistentry>
163 <term><option>--catalogs</option></term>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000164 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000165 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000166 Use the <acronym>SGML</acronym> catalog(s) from <envar>SGML_CATALOG_FILES</envar>.
167 Otherwise <acronym>XML</acronym> catalogs starting
168 from <filename>/etc/xml/catalog</filename> are used by default.
Daniel Veillard46f97212006-02-20 08:58:51 +0000169 </para>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000170 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000171 </varlistentry>
172
173 <varlistentry>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000174 <term><option>--chkregister</option></term>
175 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000176 <para>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000177 Turn on node registration. Useful for developers testing <citerefentry>
178 <refentrytitle>libxml</refentrytitle>
179 <manvolnum>3</manvolnum>
180 </citerefentry> node tracking code.
Daniel Veillard46f97212006-02-20 08:58:51 +0000181 </para>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000182 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000183 </varlistentry>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000184
Daniel Veillard46f97212006-02-20 08:58:51 +0000185 <varlistentry>
186 <term><option>--compress</option></term>
187 <listitem>
188 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000189 Turn on <citerefentry>
190 <refentrytitle>gzip</refentrytitle>
191 <manvolnum>1</manvolnum>
192 </citerefentry> compression of output.
Daniel Veillard46f97212006-02-20 08:58:51 +0000193 </para>
194 </listitem>
195 </varlistentry>
196
197 <varlistentry>
198 <term><option>--copy</option></term>
199 <listitem>
200 <para>Test the internal copy implementation.</para>
201 </listitem>
202 </varlistentry>
203
204 <varlistentry>
205 <term><option>--c14n</option></term>
206 <listitem>
207 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000208 Use the W3C <acronym>XML</acronym> Canonicalisation (<acronym>C14N</acronym>) to
209 serialize the result of parsing to <filename class="devicefile">stdout</filename>.
Daniel Veillard46f97212006-02-20 08:58:51 +0000210 It keeps comments in the result.
211 </para>
212 </listitem>
213 </varlistentry>
214
215 <varlistentry>
216 <term><option>--dtdvalid <replaceable class="option">URL</replaceable></option></term>
217 <listitem>
218 <para>
219 Use the <acronym>DTD</acronym> specified by
220 an <replaceable>URL</replaceable> for validation.
221 </para>
222 </listitem>
223 </varlistentry>
224
225 <varlistentry>
226 <term><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></term>
227 <listitem>
228 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000229 Use the <acronym>DTD</acronym> specified by a Formal Public
Daniel Veillard46f97212006-02-20 08:58:51 +0000230 Identifier <replaceable>FPI</replaceable> for validation, note that this
Daniel Veillardad211982006-08-21 08:34:11 +0000231 will require a catalog exporting that Formal Public Identifier to work.
Daniel Veillard46f97212006-02-20 08:58:51 +0000232 </para>
233 </listitem>
234 </varlistentry>
235
236 <varlistentry>
237 <term><option>--debug</option></term>
238 <listitem>
239 <para>
240 Parse a file and output an annotated tree of the
241 in-memory version of the document.
242 </para>
243 </listitem>
244 </varlistentry>
245
246 <varlistentry>
247 <term><option>--debugent</option></term>
248 <listitem>
249 <para>Debug the entities defined in the document.</para>
250 </listitem>
251 </varlistentry>
252
253 <varlistentry>
254 <term><option>--dropdtd</option></term>
255 <listitem>
256 <para>Remove <acronym>DTD</acronym> from output.</para>
257 </listitem>
258 </varlistentry>
259
260 <varlistentry>
261 <term><option>--dtdattr</option></term>
262 <listitem>
263 <para>
264 Fetch external <acronym>DTD</acronym> and populate the tree with
265 inherited attributes.
266 </para>
267 </listitem>
268 </varlistentry>
269
270 <varlistentry>
271 <term><option>--encode <replaceable class="option">ENCODING</replaceable></option></term>
272 <listitem>
273 <para>Output in the given encoding.</para>
274 </listitem>
275 </varlistentry>
276
277 <varlistentry>
278 <term><option>--format</option></term>
279 <listitem>
280 <para>
281 Reformat and reindent the output. The <envar>XMLLINT_INDENT</envar>
Daniel Veillardad211982006-08-21 08:34:11 +0000282 environment variable controls the indentation. The default value is two
Daniel Veillard46f97212006-02-20 08:58:51 +0000283 spaces &quot; &quot;).
284 </para>
285 </listitem>
286 </varlistentry>
287
288 <varlistentry>
289 <term><option>--help</option></term>
290 <listitem>
291 <para>Print out a short usage summary for &xmllint;.</para>
292 </listitem>
293 </varlistentry>
294
295 <varlistentry>
296 <term><option>--html</option></term>
297 <listitem>
298 <para>Use the <acronym>HTML</acronym> parser.</para>
299 </listitem>
300 </varlistentry>
301
302 <varlistentry>
303 <term><option>--htmlout</option></term>
304 <listitem>
305 <para>
306 Output results as an <acronym>HTML</acronym> file. This
307 causes &xmllint; to output the necessary <acronym>HTML</acronym>
308 tags surrounding the result tree output so the results can be
309 displayed/viewed in a browser.
310 </para>
311 </listitem>
312 </varlistentry>
313
314 <varlistentry>
315 <term><option>--insert</option></term>
316 <listitem>
317 <para>Test for valid insertions.</para>
318 </listitem>
319 </varlistentry>
320
321 <varlistentry>
322 <term><option>--loaddtd</option></term>
323 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000324 <para>Fetch an external <acronym>DTD</acronym>.</para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000325 </listitem>
326 </varlistentry>
327
328 <varlistentry>
329 <term><option>--load-trace</option></term>
330 <listitem>
331 <para>
332 Display all the documents loaded during the processing
333 to <filename class="devicefile">stderr</filename>.
334 </para>
335 </listitem>
336 </varlistentry>
337
338 <varlistentry>
339 <term><option>--maxmem <replaceable class="option">NNBYTES</replaceable></option></term>
340 <listitem>
341 <para>
342 Test the parser memory support. <replaceable>NNBYTES</replaceable>
343 is the maximum number of bytes the library is allowed to allocate.
344 This can also be used to make sure batch processing
345 of <acronym>XML</acronym> files will not exhaust the virtual memory
346 of the server running them.
347 </para>
348 </listitem>
349 </varlistentry>
350
351 <varlistentry>
352 <term><option>--memory</option></term>
353 <listitem>
354 <para>Parse from memory.</para>
355 </listitem>
356 </varlistentry>
357
358 <varlistentry>
359 <term><option>--noblanks</option></term>
360 <listitem>
361 <para>Drop ignorable blank spaces.</para>
362 </listitem>
363 </varlistentry>
364
365 <varlistentry>
366 <term><option>--nocatalogs</option></term>
367 <listitem>
368 <para>Do not use any catalogs.</para>
369 </listitem>
370 </varlistentry>
371
372 <varlistentry>
373 <term><option>--nocdata</option></term>
374 <listitem>
375 <para>Substitute CDATA section by equivalent text nodes.</para>
376 </listitem>
377 </varlistentry>
378
379 <varlistentry>
380 <term><option>--noent</option></term>
381 <listitem>
382 <para>
383 Substitute entity values for entity references. By default, &xmllint;
384 leaves entity references in place.
385 </para>
386 </listitem>
387 </varlistentry>
388
389 <varlistentry>
390 <term><option>--nonet</option></term>
391 <listitem>
392 <para>
393 Do not use the Internet to fetch <acronym>DTD</acronym>s or entities.
394 </para>
395 </listitem>
396 </varlistentry>
397
398 <varlistentry>
399 <term><option>--noout</option></term>
400 <listitem>
401 <para>
402 Suppress output. By default, &xmllint; outputs the result tree.
403 </para>
404 </listitem>
405 </varlistentry>
406
407 <varlistentry>
408 <term><option>--nowarning</option></term>
409 <listitem>
410 <para>Do not emit warnings from the parser and/or validator.</para>
411 </listitem>
412 </varlistentry>
413
414 <varlistentry>
415 <term><option>--nowrap</option></term>
416 <listitem>
417 <para>Do not output <acronym>HTML</acronym> doc wrapper.</para>
418 </listitem>
419 </varlistentry>
420
421 <varlistentry>
422 <term><option>--noxincludenode</option></term>
423 <listitem>
424 <para>
425 Do XInclude processing but do not generate XInclude start and end nodes.
426 </para>
427 </listitem>
428 </varlistentry>
429
430 <varlistentry>
431 <term><option>--nsclean</option></term>
432 <listitem>
433 <para>Remove redundant namespace declarations.</para>
434 </listitem>
435 </varlistentry>
436
437 <varlistentry>
438 <term><option>--output <replaceable class="option">FILE</replaceable></option></term>
439 <listitem>
440 <para>
441 Define a file path where &xmllint; will save the result of parsing.
442 Usually the programs build a tree and save it
443 on <filename class="devicefile">stdout</filename>, with this option
444 the result <acronym>XML</acronym> instance will be saved onto a file.
445 </para>
446 </listitem>
447 </varlistentry>
448
449 <varlistentry>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000450 <term><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></term>
Daniel Veillard46f97212006-02-20 08:58:51 +0000451 <listitem>
452 <para>
453 Use the (space- or colon-separated) list of filesystem paths specified
454 by <replaceable>PATHS</replaceable> to load <acronym>DTD</acronym>s or
455 entities. Enclose space-separated lists by quotation marks.
456 </para>
457 </listitem>
458 </varlistentry>
459
460 <varlistentry>
461 <term><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></term>
462 <listitem>
463 <para>
464 Used to exercise the pattern recognition engine, which can be used
465 with the reader interface to the parser. It allows to select some
466 nodes in the document based on an XPath (subset) expression. Used
467 for debugging.
468 </para>
469 </listitem>
470 </varlistentry>
471
472 <varlistentry>
473 <term><option>--postvalid</option></term>
474 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000475 <para>Validate after parsing has completed.</para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000476 </listitem>
477 </varlistentry>
478
479 <varlistentry>
480 <term><option>--push</option></term>
481 <listitem>
482 <para>Use the push mode of the parser.</para>
483 </listitem>
484 </varlistentry>
485
486 <varlistentry>
487 <term><option>--recover</option></term>
488 <listitem>
489 <para>Output any parsable portions of an invalid document.</para>
490 </listitem>
491 </varlistentry>
492
493 <varlistentry>
494 <term><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></term>
495 <listitem>
496 <para>
497 Use RelaxNG file named <replaceable class="option">SCHEMA</replaceable>
498 for validation.
499 </para>
500 </listitem>
501 </varlistentry>
502
503 <varlistentry>
504 <term><option>--repeat</option></term>
505 <listitem>
506 <para>Repeat 100 times, for timing or profiling.</para>
507 </listitem>
508 </varlistentry>
509
510 <varlistentry>
511 <term><option>--schema <replaceable>SCHEMA</replaceable></option></term>
512 <listitem>
513 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000514 Use a W3C <acronym>XML</acronym> Schema file
515 named <replaceable>SCHEMA</replaceable> for validation.
Daniel Veillard46f97212006-02-20 08:58:51 +0000516 </para>
517 </listitem>
518 </varlistentry>
519
520 <varlistentry>
521 <term><option>--shell</option></term>
522 <listitem>
523 <para>
524 Run a navigating shell. Details on available commands in shell mode
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000525 are below (see <xref linkend="shell"/>).
Daniel Veillard46f97212006-02-20 08:58:51 +0000526 </para>
527 </listitem>
528 </varlistentry>
529
530 <varlistentry>
531 <term><option>--stream</option></term>
532 <listitem>
533 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000534 Use streaming <acronym>API</acronym> - useful when used in combination
Daniel Veillard46f97212006-02-20 08:58:51 +0000535 with <option>--relaxng</option> or <option>--valid</option> options
536 for validation of files that are too large to be held in memory.
537 </para>
538 </listitem>
539 </varlistentry>
540
541 <varlistentry>
542 <term><option>--testIO</option></term>
543 <listitem>
544 <para>Test user input/output support.</para>
545 </listitem>
546 </varlistentry>
547
548 <varlistentry>
549 <term><option>--timing</option></term>
550 <listitem>
551 <para>
552 Output information about the time it takes &xmllint; to perform the
553 various steps.
554 </para>
555 </listitem>
556 </varlistentry>
557
558 <varlistentry>
559 <term><option>--valid</option></term>
560 <listitem>
561 <para>
562 Determine if the document is a valid instance of the included
563 Document Type Definition (<acronym>DTD</acronym>).
564 A <acronym>DTD</acronym> to be validated against also can be
565 specified at the command line using the <option>--dtdvalid</option>
566 option. By default, &xmllint; also checks to determine if the
567 document is well-formed.
568 </para>
569 </listitem>
570 </varlistentry>
571
572 <varlistentry>
573 <term><option>--version</option></term>
574 <listitem>
575 <para>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000576 Display the version of <citerefentry>
577 <refentrytitle>libxml</refentrytitle>
578 <manvolnum>3</manvolnum>
579 </citerefentry> used.
Daniel Veillard46f97212006-02-20 08:58:51 +0000580 </para>
581 </listitem>
582 </varlistentry>
583
584 <varlistentry>
585 <term><option>--walker</option></term>
586 <listitem>
587 <para>
588 Test the walker module, which is a reader interface but for a
589 document tree, instead of using the reader <acronym>API</acronym> on
Daniel Veillardad211982006-08-21 08:34:11 +0000590 an unparsed document it works on an existing in-memory tree. Used for
Daniel Veillard46f97212006-02-20 08:58:51 +0000591 debugging.
592 </para>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry>
597 <term><option>--xinclude</option></term>
598 <listitem>
599 <para>Do XInclude processing.</para>
600 </listitem>
601 </varlistentry>
602
603 <varlistentry>
604 <term><option>--xmlout</option></term>
605 <listitem>
606 <para>
607 Used in conjunction with <option>--html</option>. Usually
608 when <acronym>HTML</acronym> is parsed the document is saved with
Daniel Veillardad211982006-08-21 08:34:11 +0000609 the <acronym>HTML</acronym> serializer. But with this option the
Daniel Veillard46f97212006-02-20 08:58:51 +0000610 resulting document is saved with the <acronym>XML</acronym>
611 serializer. This is primarily used to
Daniel Veillardad211982006-08-21 08:34:11 +0000612 generate <acronym>XHTML</acronym> from <acronym>HTML</acronym> input.
Daniel Veillard46f97212006-02-20 08:58:51 +0000613 </para>
614 </listitem>
615 </varlistentry>
616
617 </variablelist>
618</refsect1>
619
620<refsect1 id="shell">
621 <title>SHELL COMMANDS</title>
622 <para>
623 &xmllint; offers an interactive shell mode invoked with
624 the <option>--shell</option> command. Available commands in shell mode
625 include (in alphabetical order):
626 </para>
627 <variablelist>
628
629 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000630 <term><command>base</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000631 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000632 <para>Display <acronym>XML</acronym> base of the node.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000633 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000634 </varlistentry>
635
636 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000637 <term><command>bye</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000638 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000639 <para>Leave the shell.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000640 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000641 </varlistentry>
642
643 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000644 <term><command>cat <replaceable>NODE</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000645 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000646 <para>Display the given node or the current one.</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>cd <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000652 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000653 <para>
654 Change the current node to the given path (if unique) or root if no
655 argument is given.
656 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000657 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000658 </varlistentry>
659
660 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000661 <term><command>dir <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000662 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000663 <para>
664 Dumps information about the node (namespace, attributes, content).
665 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000666 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000667 </varlistentry>
668
669 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000670 <term><command>du <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000671 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000672 <para>
673 Show the structure of the subtree under the given path or the current node.
674 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000675 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000676 </varlistentry>
677
678 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000679 <term><command>exit</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000680 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000681 <para>Leave the shell.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000682 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000683 </varlistentry>
684
685 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000686 <term><command>help</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000687 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000688 <para>Show this help.</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>free</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000694 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000695 <para>Display memory usage.</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>load <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000701 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000702 <para>Load a new document with the given filename.</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>ls <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000708 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000709 <para>List contents of the given path or the current directory.</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>pwd</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000715 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000716 <para>Display the path to the current node.</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>quit</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000722 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000723 <para>Leave the shell.</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>save <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000729 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000730 <para>
731 Save the current document to the given filename or to the original name.
732 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000733 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000734 </varlistentry>
735
736 <varlistentry>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000737 <term><option>validate</option></term>
738 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000739 <para>Check the document for errors.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000740 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000741 </varlistentry>
742
743 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000744 <term><command>write <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000745 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000746 <para>Write the current node to the given filename.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000747 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000748 </varlistentry>
749
750 </variablelist>
751</refsect1>
752
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000753<refsect1 id="environment">
Daniel Veillard46f97212006-02-20 08:58:51 +0000754 <title>ENVIRONMENT</title>
755 <variablelist>
756
757 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000758 <term><envar>SGML_CATALOG_FILES</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000759 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000760 <para><acronym>SGML</acronym> catalog behavior can be changed by redirecting
761 queries to the user's own set of catalogs. This can be done by setting
762 the <envar>SGML_CATALOG_FILES</envar> environment variable to a list
763 of catalogs. An empty one should deactivate loading the
764 default <filename>/etc/sgml/catalog</filename> catalog.
765 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000766 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000767 </varlistentry>
768
769 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000770 <term><envar>XML_CATALOG_FILES</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000771 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000772 <para><acronym>XML</acronym> catalog behavior can be changed by redirecting
773 queries to the user's own set of catalogs. This can be done by setting
Daniel Veillard46f97212006-02-20 08:58:51 +0000774 the <envar>XML_CATALOG_FILES</envar> environment variable to a list
775 of catalogs. An empty one should deactivate loading the
Daniel Veillardad211982006-08-21 08:34:11 +0000776 default <filename>/etc/xml/catalog</filename> catalog.
Daniel Veillard46f97212006-02-20 08:58:51 +0000777 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000778 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000779 </varlistentry>
780
781 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000782 <term><envar>XML_DEBUG_CATALOG</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000783 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000784 <para>Setting the environment variable <envar>XML_DEBUG_CATALOG</envar>
785 to <parameter>non-zero</parameter> using the <command>export</command>
786 command outputs debugging information related to catalog operations.
Daniel Veillard46f97212006-02-20 08:58:51 +0000787 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000788 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000789 </varlistentry>
790
791 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000792 <term><envar>XMLLINT_INDENT</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000793 <listitem>
Daniel Veillardad211982006-08-21 08:34:11 +0000794 <para>Setting the environment variable <envar>XMLLINT_INDENT</envar>
795 controls the indentation. The default value is two spaces &quot; &quot;.
796 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000797 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000798 </varlistentry>
799
800 </variablelist>
801</refsect1>
802
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000803<refsect1 id="diagnostics">
Daniel Veillard46f97212006-02-20 08:58:51 +0000804 <title>DIAGNOSTICS</title>
805 <para>
Daniel Veillardad211982006-08-21 08:34:11 +0000806 &xmllint; return codes provide information that can be used when
807 calling it from scripts.
Daniel Veillard46f97212006-02-20 08:58:51 +0000808 </para>
Daniel Veillard1589e8d2006-04-06 12:57:09 +0000809 <!-- better use segmentedlist element later,
810 which is currently only supported in snapshots -->
811 <variablelist>
812
813 <varlistentry>
814 <term><errorcode>0</errorcode></term>
815 <listitem>
816 <para>No error</para>
817 </listitem>
818 </varlistentry>
819
820 <varlistentry>
821 <term><errorcode>1</errorcode></term>
822 <listitem>
823 <para>Unclassified</para>
824 </listitem>
825 </varlistentry>
826
827 <varlistentry>
828 <term><errorcode>2</errorcode></term>
829 <listitem>
830 <para>Error in <acronym>DTD</acronym></para>
831 </listitem>
832 </varlistentry>
833
834 <varlistentry>
835 <term><errorcode>3</errorcode></term>
836 <listitem>
837 <para>Validation error</para>
838 </listitem>
839 </varlistentry>
840
841 <varlistentry>
842 <term><errorcode>4</errorcode></term>
843 <listitem>
844 <para>Validation error</para>
845 </listitem>
846 </varlistentry>
847
848 <varlistentry>
849 <term><errorcode>5</errorcode></term>
850 <listitem>
851 <para>Error in schema compilation</para>
852 </listitem>
853 </varlistentry>
854
855 <varlistentry>
856 <term><errorcode>6</errorcode></term>
857 <listitem>
858 <para>Error writing output</para>
859 </listitem>
860 </varlistentry>
861
862 <varlistentry>
863 <term><errorcode>7</errorcode></term>
864 <listitem>
865 <para>
866 Error in pattern (generated when <option>--pattern</option> option is used)
867 </para>
868 </listitem>
869 </varlistentry>
870
871 <varlistentry>
872 <term><errorcode>8</errorcode></term>
873 <listitem>
874 <para>
875 Error in Reader registration (generated
876 when <option>--chkregister</option> option is used)
877 </para>
878 </listitem>
879 </varlistentry>
880
881 <varlistentry>
882 <term><errorcode>9</errorcode></term>
883 <listitem>
884 <para>Out of memory error</para>
885 </listitem>
886 </varlistentry>
887
888 </variablelist>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000889</refsect1>
Daniel Veillard46f97212006-02-20 08:58:51 +0000890
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000891<refsect1 id="seealso">
892 <title>SEE ALSO</title>
Daniel Veillardad211982006-08-21 08:34:11 +0000893 <para><citerefentry>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000894 <refentrytitle>libxml</refentrytitle>
895 <manvolnum>3</manvolnum>
896 </citerefentry>
897 </para>
Daniel Veillardad211982006-08-21 08:34:11 +0000898 <para>
899 More information can be found at
900 <itemizedlist>
901 <listitem>
902 <para><citerefentry>
903 <refentrytitle>libxml</refentrytitle>
904 <manvolnum>3</manvolnum>
905 </citerefentry> web page <ulink url="http://www.xmlsoft.org/"/>
906 </para>
907 </listitem>
908 <listitem>
909 <para>W3C <acronym>XSLT</acronym> page <ulink url="http://www.w3.org/TR/xslt"/>
910 </para>
911 </listitem>
912 </itemizedlist>
913 </para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000914</refsect1>
915
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000916</refentry>