xref: /aosp_15_r20/external/libxml2/doc/xmllint.xml (revision 7c5688314b92172186c154356a6374bf7684c3ca)
1<?xml version="1.0"?>
2<?xml-stylesheet type="text/xsl"
3   href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
4<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
5    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
6
7    <!ENTITY xmllint "<command>xmllint</command>">
8]>
9
10<refentry>
11
12<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>[email protected]</email>
26                </address>
27            </affiliation>
28        </author>
29        <author>
30            <firstname>Ziying</firstname>
31            <surname>Sherwin</surname>
32            <affiliation>
33                <address>
34                    <email>[email protected]</email>
35                </address>
36            </affiliation>
37        </author>
38        <author>
39            <firstname>Heiko</firstname>
40            <surname>Rupp</surname>
41            <affiliation>
42                <address>
43                    <email>[email protected]</email>
44                </address>
45            </affiliation>
46        </author>
47    </authorgroup>
48    <!-- still a bit buggy output, will talk to docbook-xsl upstream to fix this -->
49    <!-- <releaseinfo>This is release 0.5 of the xmllint Manual.</releaseinfo> -->
50    <!-- <edition>0.5</edition> -->
51</refentryinfo>
52
53<refmeta>
54    <refentrytitle>xmllint</refentrytitle>
55    <manvolnum>1</manvolnum>
56</refmeta>
57
58<refnamediv>
59    <refname>xmllint</refname>
60    <refpurpose>command line <acronym>XML</acronym> tool</refpurpose>
61</refnamediv>
62
63<refsynopsisdiv>
64    <cmdsynopsis>
65    <command>xmllint</command>
66        <group choice="opt">
67            <arg choice="plain"><option>--version</option></arg>
68            <arg choice="plain"><option>--debug</option></arg>
69            <arg choice="plain"><option>--quiet</option></arg>
70            <arg choice="plain"><option>--shell</option></arg>
71            <arg choice="plain"><option>--xpath "<replaceable class="option">XPath_expression</replaceable>"</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>--huge</option></arg>
76            <arg choice="plain"><option>--nocompact</option></arg>
77            <arg choice="plain"><option>--nodefdtd</option></arg>
78            <arg choice="plain"><option>--nodict</option></arg>
79            <arg choice="plain"><option>--noenc</option></arg>
80            <arg choice="plain"><option>--noent</option></arg>
81            <arg choice="plain"><option>--nofixup-base-uris</option></arg>
82            <arg choice="plain"><option>--noout</option></arg>
83            <arg choice="plain"><option>--nonet</option></arg>
84            <arg choice="plain"><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></arg>
85            <arg choice="plain"><option>--load-trace</option></arg>
86            <arg choice="plain"><option>--htmlout</option></arg>
87            <arg choice="plain"><option>--nowrap</option></arg>
88            <arg choice="plain"><option>--valid</option></arg>
89            <arg choice="plain"><option>--postvalid</option></arg>
90            <arg choice="plain"><option>--dtdvalid <replaceable class="option">URL</replaceable></option></arg>
91            <arg choice="plain"><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></arg>
92            <arg choice="plain"><option>--timing</option></arg>
93            <arg choice="plain"><option>--output <replaceable class="option">FILE</replaceable></option></arg>
94            <arg choice="plain"><option>--repeat</option></arg>
95            <arg choice="plain"><option>--insert</option></arg>
96            <arg choice="plain"><option>--compress</option></arg>
97            <arg choice="plain"><option>--html</option></arg>
98            <arg choice="plain"><option>--xmlout</option></arg>
99            <arg choice="plain"><option>--push</option></arg>
100            <arg choice="plain"><option>--memory</option></arg>
101            <arg choice="plain"><option>--max-ampl <replaceable class="option">INTEGER</replaceable></option></arg>
102            <arg choice="plain"><option>--maxmem <replaceable class="option">NBBYTES</replaceable></option></arg>
103            <arg choice="plain"><option>--nowarning</option></arg>
104            <arg choice="plain"><option>--noblanks</option></arg>
105            <arg choice="plain"><option>--nocdata</option></arg>
106            <arg choice="plain"><option>--format</option></arg>
107            <arg choice="plain"><option>--pretty <replaceable class="option">INTEGER</replaceable></option></arg>
108            <arg choice="plain"><option>--encode <replaceable class="option">ENCODING</replaceable></option></arg>
109            <arg choice="plain"><option>--dropdtd</option></arg>
110            <arg choice="plain"><option>--nsclean</option></arg>
111            <arg choice="plain"><option>--testIO</option></arg>
112            <arg choice="plain"><option>--catalogs</option></arg>
113            <arg choice="plain"><option>--nocatalogs</option></arg>
114            <arg choice="plain"><option>--auto</option></arg>
115            <arg choice="plain"><option>--xinclude</option></arg>
116            <arg choice="plain"><option>--noxincludenode</option></arg>
117            <arg choice="plain"><option>--loaddtd</option></arg>
118            <arg choice="plain"><option>--dtdattr</option></arg>
119            <arg choice="plain"><option>--stream</option></arg>
120            <arg choice="plain"><option>--walker</option></arg>
121            <arg choice="plain"><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></arg>
122            <arg choice="plain"><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></arg>
123            <arg choice="plain"><option>--schema <replaceable class="option">SCHEMA</replaceable></option></arg>
124            <arg choice="plain"><option>--schematron <replaceable class="option">SCHEMA</replaceable></option></arg>
125            <arg choice="plain"><option>--c14n</option></arg>
126            <arg choice="plain"><option>--c14n11</option></arg>
127            <arg choice="plain"><option>--exc-c14n</option></arg>
128            <arg choice="plain"><option>--pedantic</option></arg>
129            <arg choice="plain"><option>--sax</option></arg>
130            <arg choice="plain"><option>--sax1</option></arg>
131            <arg choice="plain"><option>--oldxml10</option></arg>
132        </group>
133        <group choice="req">
134            <arg choice="plain" rep="repeat"><replaceable>XML-FILE(S)</replaceable></arg>
135            <arg choice="plain" rep="norepeat">-</arg>
136        </group>
137    </cmdsynopsis>
138</refsynopsisdiv>
139
140<refsect1 id="description">
141    <title>DESCRIPTION</title>
142    <para>
143        The &xmllint; program parses one or more <acronym>XML</acronym> files,
144        specified on the command line as <replaceable>XML-FILE</replaceable>
145        (or the standard input if the filename provided
146        is <emphasis role="bold">-</emphasis> ). It prints various types of
147        output, depending upon the options selected. It is useful for detecting
148        errors both in <acronym>XML</acronym> code and in
149        the <acronym>XML</acronym> parser itself.
150    </para>
151    <para>&xmllint; is included in <citerefentry>
152        <refentrytitle>libxml</refentrytitle>
153        <manvolnum>3</manvolnum>
154    </citerefentry>.</para>
155</refsect1>
156
157<refsect1 id="options">
158    <title>OPTIONS</title>
159    <para>
160        &xmllint; accepts the following options (in alphabetical order):
161    </para>
162
163    <variablelist>
164
165        <varlistentry>
166            <term><option>--auto</option></term>
167            <listitem>
168                <para>Generate a small document for testing purposes.</para>
169            </listitem>
170        </varlistentry>
171
172        <varlistentry>
173            <term><option>--catalogs</option></term>
174            <listitem>
175                <para>
176                    Use the <acronym>SGML</acronym> catalog(s) from <envar>SGML_CATALOG_FILES</envar>.
177                    Otherwise <acronym>XML</acronym> catalogs starting
178                    from <filename>/etc/xml/catalog</filename> or, more specifically,
179                    <filename>${sysconfdir}/xml/catalog</filename> are used by default.
180                </para>
181            </listitem>
182        </varlistentry>
183
184        <varlistentry>
185            <term><option>--compress</option></term>
186            <listitem>
187                <para>
188                    Turn on <citerefentry>
189                <refentrytitle>gzip</refentrytitle>
190                <manvolnum>1</manvolnum>
191            </citerefentry> compression of output.
192                </para>
193            </listitem>
194        </varlistentry>
195
196        <varlistentry>
197            <term><option>--copy</option></term>
198            <listitem>
199                <para>Test the internal copy implementation.</para>
200            </listitem>
201        </varlistentry>
202
203        <varlistentry>
204            <term><option>--c14n</option></term>
205            <term><option>--c14n11</option></term>
206            <term><option>--exc-c14n</option></term>
207            <listitem>
208                <para>
209                    Use the W3C <acronym>XML</acronym> Canonicalisation (<acronym>C14N</acronym>) to
210                    serialize the result of parsing to <filename class="devicefile">stdout</filename>.
211                    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>
230                    Use the <acronym>DTD</acronym> specified by a Formal Public
231                    Identifier <replaceable>FPI</replaceable> for validation, note that this
232                    will require a catalog exporting that Formal Public Identifier to work.
233                </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>
274                <para>Output in the given encoding. Note that this works for full document not fragments or result from XPath queries.</para>
275            </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>
283                    environment variable controls the indentation. The default value is two
284                    spaces &quot;  &quot;).
285                </para>
286            </listitem>
287        </varlistentry>
288
289        <varlistentry>
290            <term><option>--html</option></term>
291            <listitem>
292                <para>Use the <acronym>HTML</acronym> parser.</para>
293            </listitem>
294        </varlistentry>
295
296        <varlistentry>
297            <term><option>--htmlout</option></term>
298            <listitem>
299                <para>
300                    Output results as an <acronym>HTML</acronym> file. This
301                    causes &xmllint; to output the necessary <acronym>HTML</acronym>
302                    tags surrounding the result tree output so the results can be
303                    displayed/viewed in a browser.
304                </para>
305            </listitem>
306        </varlistentry>
307
308        <varlistentry>
309            <term><option>--huge</option></term>
310            <listitem>
311                <para>Ignore some hardcoded parser limits.</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>
325                <para>Fetch an external <acronym>DTD</acronym>.</para>
326            </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>--max-ampl <replaceable class="option">INTEGER</replaceable></option></term>
341            <listitem>
342                <para>
343                    Set the maximum amplification factor which protects against
344                    exponential entity expansion ("billion laughs"). The default value
345                    is 5. Documents making heavy use of entity expansion may require a
346                    higher value.
347                </para>
348            </listitem>
349        </varlistentry>
350
351        <varlistentry>
352            <term><option>--maxmem <replaceable class="option">NNBYTES</replaceable></option></term>
353            <listitem>
354                <para>
355                    Test the parser memory support. <replaceable>NNBYTES</replaceable>
356                    is the maximum number of bytes the library is allowed to allocate.
357                    This can also be used to make sure batch processing
358                    of <acronym>XML</acronym> files will not exhaust the virtual memory
359                    of the server running them.
360                </para>
361            </listitem>
362        </varlistentry>
363
364        <varlistentry>
365            <term><option>--memory</option></term>
366            <listitem>
367                <para>Parse from memory.</para>
368            </listitem>
369        </varlistentry>
370
371        <varlistentry>
372            <term><option>--noblanks</option></term>
373            <listitem>
374                <para>Drop ignorable blank spaces.</para>
375            </listitem>
376        </varlistentry>
377
378        <varlistentry>
379            <term><option>--nocatalogs</option></term>
380            <listitem>
381                <para>Do not use any catalogs.</para>
382            </listitem>
383        </varlistentry>
384
385        <varlistentry>
386            <term><option>--nocdata</option></term>
387            <listitem>
388                <para>Substitute CDATA section by equivalent text nodes.</para>
389            </listitem>
390        </varlistentry>
391
392        <varlistentry>
393            <term><option>--nocompact</option></term>
394            <listitem>
395                <para>
396                    Do not generate compact text nodes (parser option
397                    XML_PARSE_COMPACT). Only for debugging.
398                </para>
399            </listitem>
400        </varlistentry>
401
402        <varlistentry>
403            <term><option>--nodefdtd</option></term>
404            <listitem>
405                <para>
406                    Do not set default HTML doctype (parser option
407                    HTML_PARSE_NODEFDTD).
408                </para>
409            </listitem>
410        </varlistentry>
411
412        <varlistentry>
413            <term><option>--nodict</option></term>
414            <listitem>
415                <para>
416                    Don't use dictionaries (parser option XML_PARSE_NODICT).
417                    Only for debugging.
418                </para>
419            </listitem>
420        </varlistentry>
421
422        <varlistentry>
423            <term><option>--noenc</option></term>
424            <listitem>
425                <para>
426                    Ignore encoding declaration (parser option
427                    XML_PARSE_IGNORE_ENC).
428                </para>
429            </listitem>
430        </varlistentry>
431
432        <varlistentry>
433            <term><option>--noent</option></term>
434            <listitem>
435                <para>
436                    Substitute entity values for entity references. By default, &xmllint;
437                    leaves entity references in place.
438                </para>
439            </listitem>
440        </varlistentry>
441
442        <varlistentry>
443            <term><option>--nofixup-base-uris</option></term>
444            <listitem>
445                <para>
446                    Don't fix xml:base URIs when processing XIncludes
447                    (parser option XML_PARSE_NOBASEFIX).
448                </para>
449            </listitem>
450        </varlistentry>
451
452        <varlistentry>
453            <term><option>--nonet</option></term>
454            <listitem>
455                <para>
456                    Do not use the Internet to fetch <acronym>DTD</acronym>s or entities.
457                </para>
458            </listitem>
459        </varlistentry>
460
461        <varlistentry>
462            <term><option>--noout</option></term>
463            <listitem>
464                <para>
465                    Suppress output. By default, &xmllint; outputs the result tree.
466                </para>
467            </listitem>
468        </varlistentry>
469
470        <varlistentry>
471            <term><option>--nowarning</option></term>
472            <listitem>
473                <para>Do not emit warnings from the parser and/or validator.</para>
474            </listitem>
475        </varlistentry>
476
477        <varlistentry>
478            <term><option>--nowrap</option></term>
479            <listitem>
480                <para>Do not output <acronym>HTML</acronym> doc wrapper.</para>
481            </listitem>
482        </varlistentry>
483
484        <varlistentry>
485            <term><option>--noxincludenode</option></term>
486            <listitem>
487                <para>
488                    Do XInclude processing but do not generate XInclude start and end nodes.
489                </para>
490            </listitem>
491        </varlistentry>
492
493        <varlistentry>
494            <term><option>--nsclean</option></term>
495            <listitem>
496                <para>Remove redundant namespace declarations.</para>
497            </listitem>
498        </varlistentry>
499
500        <varlistentry>
501            <term><option>--oldxml10</option></term>
502            <listitem>
503                <para>
504                    Use deprecated parsing rules before XML 1.0,
505                    5th edition.
506                </para>
507            </listitem>
508        </varlistentry>
509
510        <varlistentry>
511            <term><option>--output <replaceable class="option">FILE</replaceable></option></term>
512            <listitem>
513                <para>
514                    Define a file path where &xmllint; will save the result of parsing.
515                    Usually the programs build a tree and save it
516                    on <filename class="devicefile">stdout</filename>, with this option
517                    the result <acronym>XML</acronym> instance will be saved onto a file.
518                </para>
519            </listitem>
520        </varlistentry>
521
522        <varlistentry>
523            <term><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></term>
524            <listitem>
525                <para>
526                    Use the (space- or colon-separated) list of filesystem paths specified
527                    by <replaceable>PATHS</replaceable> to load <acronym>DTD</acronym>s or
528                    entities. Enclose space-separated lists by quotation marks.
529                </para>
530            </listitem>
531        </varlistentry>
532
533        <varlistentry>
534            <term><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></term>
535            <listitem>
536                <para>
537                    Used to exercise the pattern recognition engine, which can be used
538                    with the reader interface to the parser. It allows to select some
539                    nodes in the document based on an XPath (subset) expression. Used
540                    for debugging.
541                </para>
542            </listitem>
543        </varlistentry>
544
545        <varlistentry>
546            <term><option>--pedantic</option></term>
547            <listitem>
548                <para>Enable additional warnings.</para>
549            </listitem>
550        </varlistentry>
551
552        <varlistentry>
553            <term><option>--postvalid</option></term>
554            <listitem>
555                <para>Validate after parsing has completed.</para>
556            </listitem>
557        </varlistentry>
558
559        <varlistentry>
560            <term><option>--pretty <replaceable class="option">INTEGER</replaceable></option></term>
561            <listitem>
562                <para>
563                    Value 0 means no formatting, 1 means XML_SAVE_FORMAT
564                    (same as --format), 2 means XML_SAVE_WSNONSIG.
565                </para>
566            </listitem>
567        </varlistentry>
568
569        <varlistentry>
570            <term><option>--push</option></term>
571            <listitem>
572                <para>Use the push mode of the parser.</para>
573            </listitem>
574        </varlistentry>
575
576        <varlistentry>
577            <term><option>--quiet</option></term>
578            <listitem>
579                <para>Don't print informational messages to stderr.</para>
580            </listitem>
581        </varlistentry>
582
583        <varlistentry>
584            <term><option>--recover</option></term>
585            <listitem>
586                <para>Output any parsable portions of an invalid document.</para>
587            </listitem>
588        </varlistentry>
589
590        <varlistentry>
591            <term><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></term>
592            <listitem>
593                <para>
594                    Use RelaxNG file named <replaceable class="option">SCHEMA</replaceable>
595                    for validation.
596                </para>
597            </listitem>
598        </varlistentry>
599
600        <varlistentry>
601            <term><option>--repeat</option></term>
602            <listitem>
603                <para>Repeat 100 times, for timing or profiling.</para>
604            </listitem>
605        </varlistentry>
606
607        <varlistentry>
608            <term><option>--sax</option></term>
609            <listitem>
610                <para>Print SAX callbacks (only for debugging).</para>
611            </listitem>
612        </varlistentry>
613
614        <varlistentry>
615            <term><option>--sax1</option></term>
616            <listitem>
617                <para>Use deprecated SAX1 interface (only for debugging).</para>
618            </listitem>
619        </varlistentry>
620
621        <varlistentry>
622            <term><option>--schema <replaceable>SCHEMA</replaceable></option></term>
623            <listitem>
624                <para>
625                    Use a W3C <acronym>XML</acronym> Schema file
626                    named <replaceable>SCHEMA</replaceable> for validation.
627                </para>
628            </listitem>
629        </varlistentry>
630
631        <varlistentry>
632            <term><option>--schematron <replaceable>SCHEMA</replaceable></option></term>
633            <listitem>
634                <para>
635                    Use a Schematron file
636                    named <replaceable>SCHEMA</replaceable> for validation.
637                </para>
638            </listitem>
639        </varlistentry>
640
641        <varlistentry>
642            <term><option>--shell</option></term>
643            <listitem>
644                <para>
645                    Run a navigating shell. Details on available commands in shell mode
646                    are below (see <xref linkend="shell"/>).
647                </para>
648            </listitem>
649        </varlistentry>
650
651        <varlistentry>
652            <term><option>--xpath "<replaceable class="option">XPath_expression</replaceable>"</option></term>
653            <listitem>
654                <para>
655                    Run an XPath expression given as argument and print the
656                    result. In case of a nodeset result, each node in the
657                    node set is serialized in full in the output. In case
658                    of an empty node set the "XPath set is empty" result
659                    will be shown and exit code 11 will be returned..
660                    This feature is EXPERIMENTAL. Implementation details can
661                    change without futher notice.
662                </para>
663            </listitem>
664        </varlistentry>
665
666        <varlistentry>
667            <term><option>--stream</option></term>
668            <listitem>
669                <para>
670                    Use streaming <acronym>API</acronym> - useful when used in combination
671                    with <option>--relaxng</option> or <option>--valid</option> options
672                    for validation of files that are too large to be held in memory.
673                </para>
674            </listitem>
675        </varlistentry>
676
677        <varlistentry>
678            <term><option>--testIO</option></term>
679            <listitem>
680                <para>Test user input/output support.</para>
681            </listitem>
682        </varlistentry>
683
684        <varlistentry>
685            <term><option>--timing</option></term>
686            <listitem>
687                <para>
688                    Output information about the time it takes &xmllint; to perform the
689                    various steps.
690                </para>
691            </listitem>
692        </varlistentry>
693
694        <varlistentry>
695            <term><option>--valid</option></term>
696            <listitem>
697                <para>
698                    Determine if the document is a valid instance of the included
699                    Document Type Definition (<acronym>DTD</acronym>).
700                    A <acronym>DTD</acronym> to be validated against also can be
701                    specified at the command line using the <option>--dtdvalid</option>
702                    option. By default, &xmllint; also checks to determine if the
703                    document is well-formed.
704                </para>
705            </listitem>
706        </varlistentry>
707
708        <varlistentry>
709            <term><option>--version</option></term>
710            <listitem>
711                <para>
712                    Display the version of <citerefentry>
713                <refentrytitle>libxml</refentrytitle>
714                <manvolnum>3</manvolnum>
715            </citerefentry> used.
716                </para>
717            </listitem>
718        </varlistentry>
719
720        <varlistentry>
721            <term><option>--walker</option></term>
722            <listitem>
723                <para>
724                    Test the walker module, which is a reader interface but for a
725                    document tree, instead of using the reader <acronym>API</acronym> on
726                    an unparsed document it works on an existing in-memory tree. Used for
727                    debugging.
728                </para>
729            </listitem>
730        </varlistentry>
731
732        <varlistentry>
733            <term><option>--xinclude</option></term>
734            <listitem>
735                <para>Do XInclude processing.</para>
736            </listitem>
737        </varlistentry>
738
739        <varlistentry>
740            <term><option>--xmlout</option></term>
741            <listitem>
742                <para>
743                    Used in conjunction with <option>--html</option>. Usually
744                    when <acronym>HTML</acronym> is parsed the document is saved with
745                    the <acronym>HTML</acronym> serializer. But with this option the
746                    resulting document is saved with the <acronym>XML</acronym>
747                    serializer. This is primarily used to
748                    generate <acronym>XHTML</acronym> from <acronym>HTML</acronym> input.
749                </para>
750            </listitem>
751        </varlistentry>
752
753    </variablelist>
754</refsect1>
755
756<refsect1 id="shell">
757    <title>SHELL COMMANDS</title>
758    <para>
759        &xmllint; offers an interactive shell mode invoked with
760        the <option>--shell</option> command. Available commands in shell mode
761        include (in alphabetical order):
762    </para>
763    <variablelist>
764
765        <varlistentry>
766            <term><command>base</command></term>
767            <listitem>
768                <para>Display <acronym>XML</acronym> base of the node.</para>
769            </listitem>
770        </varlistentry>
771
772        <varlistentry>
773            <term><command>bye</command></term>
774            <listitem>
775                <para>Leave the shell.</para>
776            </listitem>
777        </varlistentry>
778
779        <varlistentry>
780            <term><command>cat <replaceable>NODE</replaceable></command></term>
781            <listitem>
782                <para>Display the given node or the current one.</para>
783            </listitem>
784        </varlistentry>
785
786        <varlistentry>
787            <term><command>cd <replaceable>PATH</replaceable></command></term>
788            <listitem>
789                <para>
790                    Change the current node to the given path (if unique) or root if no
791                    argument is given.
792                </para>
793            </listitem>
794        </varlistentry>
795
796        <varlistentry>
797            <term><command>dir <replaceable>PATH</replaceable></command></term>
798            <listitem>
799                <para>
800                    Dumps information about the node (namespace, attributes, content).
801                </para>
802            </listitem>
803        </varlistentry>
804
805        <varlistentry>
806            <term><command>du <replaceable>PATH</replaceable></command></term>
807            <listitem>
808                <para>
809                    Show the structure of the subtree under the given path or the current node.
810                </para>
811            </listitem>
812        </varlistentry>
813
814        <varlistentry>
815            <term><command>exit</command></term>
816            <listitem>
817                <para>Leave the shell.</para>
818            </listitem>
819        </varlistentry>
820
821        <varlistentry>
822            <term><command>help</command></term>
823            <listitem>
824                <para>Show this help.</para>
825            </listitem>
826        </varlistentry>
827
828        <varlistentry>
829            <term><command>load <replaceable>FILENAME</replaceable></command></term>
830            <listitem>
831                <para>Load a new document with the given filename.</para>
832            </listitem>
833        </varlistentry>
834
835        <varlistentry>
836            <term><command>ls <replaceable>PATH</replaceable></command></term>
837            <listitem>
838                <para>List contents of the given path or the current directory.</para>
839            </listitem>
840        </varlistentry>
841
842        <varlistentry>
843            <term><command>pwd</command></term>
844            <listitem>
845                <para>Display the path to the current node.</para>
846            </listitem>
847        </varlistentry>
848
849        <varlistentry>
850            <term><command>quit</command></term>
851            <listitem>
852                <para>Leave the shell.</para>
853            </listitem>
854        </varlistentry>
855
856        <varlistentry>
857            <term><command>save <replaceable>FILENAME</replaceable></command></term>
858            <listitem>
859                <para>
860                    Save the current document to the given filename or to the original name.
861                </para>
862            </listitem>
863        </varlistentry>
864
865        <varlistentry>
866            <term><option>validate</option></term>
867            <listitem>
868                <para>Check the document for errors.</para>
869            </listitem>
870        </varlistentry>
871
872        <varlistentry>
873            <term><command>write <replaceable>FILENAME</replaceable></command></term>
874            <listitem>
875                <para>Write the current node to the given filename.</para>
876            </listitem>
877        </varlistentry>
878
879    </variablelist>
880</refsect1>
881
882<refsect1 id="environment">
883    <title>ENVIRONMENT</title>
884    <variablelist>
885
886        <varlistentry>
887            <term><envar>SGML_CATALOG_FILES</envar></term>
888            <listitem>
889                <para><acronym>SGML</acronym> catalog behavior can be changed by redirecting
890                    queries to the user's own set of catalogs. This can be done by setting
891                    the <envar>SGML_CATALOG_FILES</envar> environment variable to a list
892                    of catalogs. An empty one should deactivate loading the
893                    default catalog.
894                </para>
895            </listitem>
896        </varlistentry>
897
898        <varlistentry>
899            <term><envar>XML_CATALOG_FILES</envar></term>
900            <listitem>
901                <para><acronym>XML</acronym> catalog behavior can be changed by redirecting
902                    queries to the user's own set of catalogs. This can be done by setting
903                    the <envar>XML_CATALOG_FILES</envar> environment variable to a space-separated
904                    list of catalogs. Use percent-encoding to escape spaces or other characters.
905                    An empty variable should deactivate loading the default catalog.
906                </para>
907            </listitem>
908        </varlistentry>
909
910        <varlistentry>
911            <term><envar>XML_DEBUG_CATALOG</envar></term>
912            <listitem>
913                <para>Setting the environment variable <envar>XML_DEBUG_CATALOG</envar>
914                    to <parameter>non-zero</parameter> using the <command>export</command>
915                    command outputs debugging information related to catalog operations.
916                </para>
917            </listitem>
918        </varlistentry>
919
920        <varlistentry>
921            <term><envar>XMLLINT_INDENT</envar></term>
922            <listitem>
923                <para>Setting the environment variable <envar>XMLLINT_INDENT</envar>
924                    controls the indentation. The default value is two spaces &quot;  &quot;.
925                </para>
926            </listitem>
927        </varlistentry>
928
929    </variablelist>
930</refsect1>
931
932<refsect1 id="diagnostics">
933    <title>DIAGNOSTICS</title>
934    <para>
935        &xmllint; return codes provide information that can be used when
936        calling it from scripts.
937    </para>
938    <!-- better use segmentedlist element later,
939         which is currently only supported in snapshots -->
940    <variablelist>
941
942        <varlistentry>
943            <term><errorcode>0</errorcode></term>
944            <listitem>
945                <para>No error</para>
946            </listitem>
947        </varlistentry>
948
949        <varlistentry>
950            <term><errorcode>1</errorcode></term>
951            <listitem>
952                <para>Unclassified</para>
953            </listitem>
954        </varlistentry>
955
956        <varlistentry>
957            <term><errorcode>2</errorcode></term>
958            <listitem>
959                <para>Error in <acronym>DTD</acronym></para>
960            </listitem>
961        </varlistentry>
962
963        <varlistentry>
964            <term><errorcode>3</errorcode></term>
965            <listitem>
966                <para>Validation error</para>
967            </listitem>
968        </varlistentry>
969
970        <varlistentry>
971            <term><errorcode>4</errorcode></term>
972            <listitem>
973                <para>Validation error</para>
974            </listitem>
975        </varlistentry>
976
977        <varlistentry>
978            <term><errorcode>5</errorcode></term>
979            <listitem>
980                <para>Error in schema compilation</para>
981            </listitem>
982        </varlistentry>
983
984        <varlistentry>
985            <term><errorcode>6</errorcode></term>
986            <listitem>
987                <para>Error writing output</para>
988            </listitem>
989        </varlistentry>
990
991        <varlistentry>
992            <term><errorcode>7</errorcode></term>
993            <listitem>
994                <para>
995                    Error in pattern (generated when <option>--pattern</option> option is used)
996                </para>
997            </listitem>
998        </varlistentry>
999
1000        <varlistentry>
1001            <term><errorcode>9</errorcode></term>
1002            <listitem>
1003                <para>Out of memory error</para>
1004            </listitem>
1005        </varlistentry>
1006
1007        <varlistentry>
1008            <term><errorcode>10</errorcode></term>
1009            <listitem>
1010                <para>XPath evaluation error</para>
1011            </listitem>
1012        </varlistentry>
1013
1014        <varlistentry>
1015            <term><errorcode>11</errorcode></term>
1016            <listitem>
1017                <para>XPath result is empty</para>
1018            </listitem>
1019        </varlistentry>
1020
1021    </variablelist>
1022</refsect1>
1023
1024<refsect1 id="seealso">
1025    <title>SEE ALSO</title>
1026    <para><citerefentry>
1027            <refentrytitle>libxml</refentrytitle>
1028            <manvolnum>3</manvolnum>
1029        </citerefentry>
1030    </para>
1031    <para>
1032        More information can be found at
1033        <itemizedlist>
1034            <listitem>
1035                <para><citerefentry>
1036                        <refentrytitle>libxml</refentrytitle>
1037                        <manvolnum>3</manvolnum>
1038                    </citerefentry> web page <ulink url="https://gitlab.gnome.org/GNOME/libxml2"/>
1039                </para>
1040            </listitem>
1041        </itemizedlist>
1042    </para>
1043</refsect1>
1044
1045</refentry>
1046