• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>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>
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>--nodict</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>
79            <arg choice="plain"><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></arg>
80            <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>--max-ampl <replaceable class="option">INTEGER</replaceable></option></arg>
97            <arg choice="plain"><option>--maxmem <replaceable class="option">NBBYTES</replaceable></option></arg>
98            <arg choice="plain"><option>--nowarning</option></arg>
99            <arg choice="plain"><option>--noblanks</option></arg>
100            <arg choice="plain"><option>--nocdata</option></arg>
101            <arg choice="plain"><option>--format</option></arg>
102            <arg choice="plain"><option>--encode <replaceable class="option">ENCODING</replaceable></option></arg>
103            <arg choice="plain"><option>--dropdtd</option></arg>
104            <arg choice="plain"><option>--nsclean</option></arg>
105            <arg choice="plain"><option>--testIO</option></arg>
106            <arg choice="plain"><option>--catalogs</option></arg>
107            <arg choice="plain"><option>--nocatalogs</option></arg>
108            <arg choice="plain"><option>--auto</option></arg>
109            <arg choice="plain"><option>--xinclude</option></arg>
110            <arg choice="plain"><option>--noxincludenode</option></arg>
111            <arg choice="plain"><option>--loaddtd</option></arg>
112            <arg choice="plain"><option>--dtdattr</option></arg>
113            <arg choice="plain"><option>--stream</option></arg>
114            <arg choice="plain"><option>--walker</option></arg>
115            <arg choice="plain"><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></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            <arg choice="plain"><option>--pedantic</option></arg>
120        </group>
121        <group choice="req">
122            <arg choice="plain" rep="repeat"><replaceable>XML-FILE(S)</replaceable></arg>
123            <arg choice="plain" rep="norepeat">-</arg>
124        </group>
125    </cmdsynopsis>
126    <cmdsynopsis>
127        <command>xmllint</command>
128        <arg choice="plain"><option>--help</option></arg>
129    </cmdsynopsis>
130</refsynopsisdiv>
131
132<refsect1 id="description">
133    <title>DESCRIPTION</title>
134    <para>
135        The &xmllint; program parses one or more <acronym>XML</acronym> files,
136        specified on the command line as <replaceable>XML-FILE</replaceable>
137        (or the standard input if the filename provided
138        is <emphasis role="bold">-</emphasis> ). It prints various types of
139        output, depending upon the options selected. It is useful for detecting
140        errors both in <acronym>XML</acronym> code and in
141        the <acronym>XML</acronym> parser itself.
142    </para>
143    <para>&xmllint; is included in <citerefentry>
144        <refentrytitle>libxml</refentrytitle>
145        <manvolnum>3</manvolnum>
146    </citerefentry>.</para>
147</refsect1>
148
149<refsect1 id="options">
150    <title>OPTIONS</title>
151    <para>
152        &xmllint; accepts the following options (in alphabetical order):
153    </para>
154
155    <variablelist>
156
157        <varlistentry>
158            <term><option>--auto</option></term>
159            <listitem>
160                <para>Generate a small document for testing purposes.</para>
161            </listitem>
162        </varlistentry>
163
164        <varlistentry>
165            <term><option>--catalogs</option></term>
166            <listitem>
167                <para>
168                    Use the <acronym>SGML</acronym> catalog(s) from <envar>SGML_CATALOG_FILES</envar>.
169                    Otherwise <acronym>XML</acronym> catalogs starting
170                    from <filename>/etc/xml/catalog</filename> or, more specifically,
171                    <filename>${sysconfdir}/xml/catalog</filename> are used by default.
172                </para>
173            </listitem>
174        </varlistentry>
175
176        <varlistentry>
177            <term><option>--compress</option></term>
178            <listitem>
179                <para>
180                    Turn on <citerefentry>
181                <refentrytitle>gzip</refentrytitle>
182                <manvolnum>1</manvolnum>
183            </citerefentry> compression of output.
184                </para>
185            </listitem>
186        </varlistentry>
187
188        <varlistentry>
189            <term><option>--copy</option></term>
190            <listitem>
191                <para>Test the internal copy implementation.</para>
192            </listitem>
193        </varlistentry>
194
195        <varlistentry>
196            <term><option>--c14n</option></term>
197            <listitem>
198                <para>
199                    Use the W3C <acronym>XML</acronym> Canonicalisation (<acronym>C14N</acronym>) to
200                    serialize the result of parsing to <filename class="devicefile">stdout</filename>.
201                    It keeps comments in the result.
202                </para>
203            </listitem>
204        </varlistentry>
205
206        <varlistentry>
207            <term><option>--dtdvalid <replaceable class="option">URL</replaceable></option></term>
208            <listitem>
209                <para>
210                    Use the <acronym>DTD</acronym> specified by
211                    an <replaceable>URL</replaceable> for validation.
212                </para>
213            </listitem>
214        </varlistentry>
215
216        <varlistentry>
217            <term><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></term>
218            <listitem>
219                <para>
220                    Use the <acronym>DTD</acronym> specified by a Formal Public
221                    Identifier <replaceable>FPI</replaceable> for validation, note that this
222                    will require a catalog exporting that Formal Public Identifier to work.
223                </para>
224            </listitem>
225        </varlistentry>
226
227        <varlistentry>
228            <term><option>--debug</option></term>
229            <listitem>
230                <para>
231                    Parse a file and output an annotated tree of the
232                    in-memory version of the document.
233                </para>
234            </listitem>
235        </varlistentry>
236
237        <varlistentry>
238            <term><option>--debugent</option></term>
239            <listitem>
240                <para>Debug the entities defined in the document.</para>
241            </listitem>
242        </varlistentry>
243
244        <varlistentry>
245            <term><option>--dropdtd</option></term>
246            <listitem>
247                <para>Remove <acronym>DTD</acronym> from output.</para>
248            </listitem>
249        </varlistentry>
250
251        <varlistentry>
252            <term><option>--dtdattr</option></term>
253            <listitem>
254                <para>
255                    Fetch external <acronym>DTD</acronym> and populate the tree with
256                    inherited attributes.
257                </para>
258            </listitem>
259        </varlistentry>
260
261        <varlistentry>
262            <term><option>--encode <replaceable class="option">ENCODING</replaceable></option></term>
263            <listitem>
264                <para>Output in the given encoding. Note that this works for full document not fragments or result from XPath queries.</para>
265            </listitem>
266        </varlistentry>
267
268        <varlistentry>
269            <term><option>--format</option></term>
270            <listitem>
271                <para>
272                    Reformat and reindent the output. The <envar>XMLLINT_INDENT</envar>
273                    environment variable controls the indentation. The default value is two
274                    spaces &quot;  &quot;).
275                </para>
276            </listitem>
277        </varlistentry>
278
279        <varlistentry>
280            <term><option>--help</option></term>
281            <listitem>
282                <para>Print out a short usage summary for &xmllint;.</para>
283            </listitem>
284        </varlistentry>
285
286        <varlistentry>
287            <term><option>--html</option></term>
288            <listitem>
289                <para>Use the <acronym>HTML</acronym> parser.</para>
290            </listitem>
291        </varlistentry>
292
293        <varlistentry>
294            <term><option>--htmlout</option></term>
295            <listitem>
296                <para>
297                    Output results as an <acronym>HTML</acronym> file. This
298                    causes &xmllint; to output the necessary <acronym>HTML</acronym>
299                    tags surrounding the result tree output so the results can be
300                    displayed/viewed in a browser.
301                </para>
302            </listitem>
303        </varlistentry>
304
305        <varlistentry>
306            <term><option>--insert</option></term>
307            <listitem>
308                <para>Test for valid insertions.</para>
309            </listitem>
310        </varlistentry>
311
312        <varlistentry>
313            <term><option>--loaddtd</option></term>
314            <listitem>
315                <para>Fetch an external <acronym>DTD</acronym>.</para>
316            </listitem>
317        </varlistentry>
318
319        <varlistentry>
320            <term><option>--load-trace</option></term>
321            <listitem>
322                <para>
323                    Display all the documents loaded during the processing
324                    to <filename class="devicefile">stderr</filename>.
325                </para>
326            </listitem>
327        </varlistentry>
328
329        <varlistentry>
330            <term><option>--max-ampl <replaceable class="option">INTEGER</replaceable></option></term>
331            <listitem>
332                <para>
333                    Set the maximum amplification factor which protects against
334                    exponential entity expansion ("billion laughs"). The default value
335                    is 5. Documents making heavy use of entity expansion may require a
336                    higher value.
337                </para>
338            </listitem>
339        </varlistentry>
340
341        <varlistentry>
342            <term><option>--maxmem <replaceable class="option">NNBYTES</replaceable></option></term>
343            <listitem>
344                <para>
345                    Test the parser memory support. <replaceable>NNBYTES</replaceable>
346                    is the maximum number of bytes the library is allowed to allocate.
347                    This can also be used to make sure batch processing
348                    of <acronym>XML</acronym> files will not exhaust the virtual memory
349                    of the server running them.
350                </para>
351            </listitem>
352        </varlistentry>
353
354        <varlistentry>
355            <term><option>--memory</option></term>
356            <listitem>
357                <para>Parse from memory.</para>
358            </listitem>
359        </varlistentry>
360
361        <varlistentry>
362            <term><option>--noblanks</option></term>
363            <listitem>
364                <para>Drop ignorable blank spaces.</para>
365            </listitem>
366        </varlistentry>
367
368        <varlistentry>
369            <term><option>--nocatalogs</option></term>
370            <listitem>
371                <para>Do not use any catalogs.</para>
372            </listitem>
373        </varlistentry>
374
375        <varlistentry>
376            <term><option>--nocdata</option></term>
377            <listitem>
378                <para>Substitute CDATA section by equivalent text nodes.</para>
379            </listitem>
380        </varlistentry>
381
382        <varlistentry>
383            <term><option>--nodict</option></term>
384            <listitem>
385                <para>
386                    Don't use dictionaries (parser option XML_PARSE_NODICT).
387                    Only for debugging.
388                </para>
389            </listitem>
390        </varlistentry>
391
392        <varlistentry>
393            <term><option>--noent</option></term>
394            <listitem>
395                <para>
396                    Substitute entity values for entity references. By default, &xmllint;
397                    leaves entity references in place.
398                </para>
399            </listitem>
400        </varlistentry>
401
402        <varlistentry>
403            <term><option>--nonet</option></term>
404            <listitem>
405                <para>
406                    Do not use the Internet to fetch <acronym>DTD</acronym>s or entities.
407                </para>
408            </listitem>
409        </varlistentry>
410
411        <varlistentry>
412            <term><option>--noout</option></term>
413            <listitem>
414                <para>
415                    Suppress output. By default, &xmllint; outputs the result tree.
416                </para>
417            </listitem>
418        </varlistentry>
419
420        <varlistentry>
421            <term><option>--nowarning</option></term>
422            <listitem>
423                <para>Do not emit warnings from the parser and/or validator.</para>
424            </listitem>
425        </varlistentry>
426
427        <varlistentry>
428            <term><option>--nowrap</option></term>
429            <listitem>
430                <para>Do not output <acronym>HTML</acronym> doc wrapper.</para>
431            </listitem>
432        </varlistentry>
433
434        <varlistentry>
435            <term><option>--noxincludenode</option></term>
436            <listitem>
437                <para>
438                    Do XInclude processing but do not generate XInclude start and end nodes.
439                </para>
440            </listitem>
441        </varlistentry>
442
443        <varlistentry>
444            <term><option>--nsclean</option></term>
445            <listitem>
446                <para>Remove redundant namespace declarations.</para>
447            </listitem>
448        </varlistentry>
449
450        <varlistentry>
451            <term><option>--output <replaceable class="option">FILE</replaceable></option></term>
452            <listitem>
453                <para>
454                    Define a file path where &xmllint; will save the result of parsing.
455                    Usually the programs build a tree and save it
456                    on <filename class="devicefile">stdout</filename>, with this option
457                    the result <acronym>XML</acronym> instance will be saved onto a file.
458                </para>
459            </listitem>
460        </varlistentry>
461
462        <varlistentry>
463            <term><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></term>
464            <listitem>
465                <para>
466                    Use the (space- or colon-separated) list of filesystem paths specified
467                    by <replaceable>PATHS</replaceable> to load <acronym>DTD</acronym>s or
468                    entities. Enclose space-separated lists by quotation marks.
469                </para>
470            </listitem>
471        </varlistentry>
472
473        <varlistentry>
474            <term><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></term>
475            <listitem>
476                <para>
477                    Used to exercise the pattern recognition engine, which can be used
478                    with the reader interface to the parser. It allows to select some
479                    nodes in the document based on an XPath (subset) expression. Used
480                    for debugging.
481                </para>
482            </listitem>
483        </varlistentry>
484
485        <varlistentry>
486            <term><option>--pedantic</option></term>
487            <listitem>
488                <para>Enable additional warnings.</para>
489            </listitem>
490        </varlistentry>
491
492        <varlistentry>
493            <term><option>--postvalid</option></term>
494            <listitem>
495                <para>Validate after parsing has completed.</para>
496            </listitem>
497        </varlistentry>
498
499        <varlistentry>
500            <term><option>--push</option></term>
501            <listitem>
502                <para>Use the push mode of the parser.</para>
503            </listitem>
504        </varlistentry>
505
506        <varlistentry>
507            <term><option>--quiet</option></term>
508            <listitem>
509                <para>Don't print informational messages to stderr.</para>
510            </listitem>
511        </varlistentry>
512
513        <varlistentry>
514            <term><option>--recover</option></term>
515            <listitem>
516                <para>Output any parsable portions of an invalid document.</para>
517            </listitem>
518        </varlistentry>
519
520        <varlistentry>
521            <term><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></term>
522            <listitem>
523                <para>
524                    Use RelaxNG file named <replaceable class="option">SCHEMA</replaceable>
525                    for validation.
526                </para>
527            </listitem>
528        </varlistentry>
529
530        <varlistentry>
531            <term><option>--repeat</option></term>
532            <listitem>
533                <para>Repeat 100 times, for timing or profiling.</para>
534            </listitem>
535        </varlistentry>
536
537        <varlistentry>
538            <term><option>--schema <replaceable>SCHEMA</replaceable></option></term>
539            <listitem>
540                <para>
541                    Use a W3C <acronym>XML</acronym> Schema file
542                    named <replaceable>SCHEMA</replaceable> for validation.
543                </para>
544            </listitem>
545        </varlistentry>
546
547        <varlistentry>
548            <term><option>--shell</option></term>
549            <listitem>
550                <para>
551                    Run a navigating shell. Details on available commands in shell mode
552                    are below (see <xref linkend="shell"/>).
553                </para>
554            </listitem>
555        </varlistentry>
556
557        <varlistentry>
558            <term><option>--xpath "<replaceable class="option">XPath_expression</replaceable>"</option></term>
559            <listitem>
560                <para>
561                    Run an XPath expression given as argument and print the
562                    result. In case of a nodeset result, each node in the
563                    node set is serialized in full in the output. In case
564                    of an empty node set the "XPath set is empty" result
565                    will be shown and exit code 11 will be returned..
566                    This feature is EXPERIMENTAL. Implementation details can
567                    change without futher notice.
568                </para>
569            </listitem>
570        </varlistentry>
571
572        <varlistentry>
573            <term><option>--stream</option></term>
574            <listitem>
575                <para>
576                    Use streaming <acronym>API</acronym> - useful when used in combination
577                    with <option>--relaxng</option> or <option>--valid</option> options
578                    for validation of files that are too large to be held in memory.
579                </para>
580            </listitem>
581        </varlistentry>
582
583        <varlistentry>
584            <term><option>--testIO</option></term>
585            <listitem>
586                <para>Test user input/output support.</para>
587            </listitem>
588        </varlistentry>
589
590        <varlistentry>
591            <term><option>--timing</option></term>
592            <listitem>
593                <para>
594                    Output information about the time it takes &xmllint; to perform the
595                    various steps.
596                </para>
597            </listitem>
598        </varlistentry>
599
600        <varlistentry>
601            <term><option>--valid</option></term>
602            <listitem>
603                <para>
604                    Determine if the document is a valid instance of the included
605                    Document Type Definition (<acronym>DTD</acronym>).
606                    A <acronym>DTD</acronym> to be validated against also can be
607                    specified at the command line using the <option>--dtdvalid</option>
608                    option. By default, &xmllint; also checks to determine if the
609                    document is well-formed.
610                </para>
611            </listitem>
612        </varlistentry>
613
614        <varlistentry>
615            <term><option>--version</option></term>
616            <listitem>
617                <para>
618                    Display the version of <citerefentry>
619                <refentrytitle>libxml</refentrytitle>
620                <manvolnum>3</manvolnum>
621            </citerefentry> used.
622                </para>
623            </listitem>
624        </varlistentry>
625
626        <varlistentry>
627            <term><option>--walker</option></term>
628            <listitem>
629                <para>
630                    Test the walker module, which is a reader interface but for a
631                    document tree, instead of using the reader <acronym>API</acronym> on
632                    an unparsed document it works on an existing in-memory tree. Used for
633                    debugging.
634                </para>
635            </listitem>
636        </varlistentry>
637
638        <varlistentry>
639            <term><option>--xinclude</option></term>
640            <listitem>
641                <para>Do XInclude processing.</para>
642            </listitem>
643        </varlistentry>
644
645        <varlistentry>
646            <term><option>--xmlout</option></term>
647            <listitem>
648                <para>
649                    Used in conjunction with <option>--html</option>. Usually
650                    when <acronym>HTML</acronym> is parsed the document is saved with
651                    the <acronym>HTML</acronym> serializer. But with this option the
652                    resulting document is saved with the <acronym>XML</acronym>
653                    serializer. This is primarily used to
654                    generate <acronym>XHTML</acronym> from <acronym>HTML</acronym> input.
655                </para>
656            </listitem>
657        </varlistentry>
658
659    </variablelist>
660</refsect1>
661
662<refsect1 id="shell">
663    <title>SHELL COMMANDS</title>
664    <para>
665        &xmllint; offers an interactive shell mode invoked with
666        the <option>--shell</option> command. Available commands in shell mode
667        include (in alphabetical order):
668    </para>
669    <variablelist>
670
671        <varlistentry>
672            <term><command>base</command></term>
673            <listitem>
674                <para>Display <acronym>XML</acronym> base of the node.</para>
675            </listitem>
676        </varlistentry>
677
678        <varlistentry>
679            <term><command>bye</command></term>
680            <listitem>
681                <para>Leave the shell.</para>
682            </listitem>
683        </varlistentry>
684
685        <varlistentry>
686            <term><command>cat <replaceable>NODE</replaceable></command></term>
687            <listitem>
688                <para>Display the given node or the current one.</para>
689            </listitem>
690        </varlistentry>
691
692        <varlistentry>
693            <term><command>cd <replaceable>PATH</replaceable></command></term>
694            <listitem>
695                <para>
696                    Change the current node to the given path (if unique) or root if no
697                    argument is given.
698                </para>
699            </listitem>
700        </varlistentry>
701
702        <varlistentry>
703            <term><command>dir <replaceable>PATH</replaceable></command></term>
704            <listitem>
705                <para>
706                    Dumps information about the node (namespace, attributes, content).
707                </para>
708            </listitem>
709        </varlistentry>
710
711        <varlistentry>
712            <term><command>du <replaceable>PATH</replaceable></command></term>
713            <listitem>
714                <para>
715                    Show the structure of the subtree under the given path or the current node.
716                </para>
717            </listitem>
718        </varlistentry>
719
720        <varlistentry>
721            <term><command>exit</command></term>
722            <listitem>
723                <para>Leave the shell.</para>
724            </listitem>
725        </varlistentry>
726
727        <varlistentry>
728            <term><command>help</command></term>
729            <listitem>
730                <para>Show this help.</para>
731            </listitem>
732        </varlistentry>
733
734        <varlistentry>
735            <term><command>load <replaceable>FILENAME</replaceable></command></term>
736            <listitem>
737                <para>Load a new document with the given filename.</para>
738            </listitem>
739        </varlistentry>
740
741        <varlistentry>
742            <term><command>ls <replaceable>PATH</replaceable></command></term>
743            <listitem>
744                <para>List contents of the given path or the current directory.</para>
745            </listitem>
746        </varlistentry>
747
748        <varlistentry>
749            <term><command>pwd</command></term>
750            <listitem>
751                <para>Display the path to the current node.</para>
752            </listitem>
753        </varlistentry>
754
755        <varlistentry>
756            <term><command>quit</command></term>
757            <listitem>
758                <para>Leave the shell.</para>
759            </listitem>
760        </varlistentry>
761
762        <varlistentry>
763            <term><command>save <replaceable>FILENAME</replaceable></command></term>
764            <listitem>
765                <para>
766                    Save the current document to the given filename or to the original name.
767                </para>
768            </listitem>
769        </varlistentry>
770
771        <varlistentry>
772            <term><option>validate</option></term>
773            <listitem>
774                <para>Check the document for errors.</para>
775            </listitem>
776        </varlistentry>
777
778        <varlistentry>
779            <term><command>write <replaceable>FILENAME</replaceable></command></term>
780            <listitem>
781                <para>Write the current node to the given filename.</para>
782            </listitem>
783        </varlistentry>
784
785    </variablelist>
786</refsect1>
787
788<refsect1 id="environment">
789    <title>ENVIRONMENT</title>
790    <variablelist>
791
792        <varlistentry>
793            <term><envar>SGML_CATALOG_FILES</envar></term>
794            <listitem>
795                <para><acronym>SGML</acronym> catalog behavior can be changed by redirecting
796                    queries to the user's own set of catalogs. This can be done by setting
797                    the <envar>SGML_CATALOG_FILES</envar> environment variable to a list
798                    of catalogs. An empty one should deactivate loading the
799                    default catalog.
800                </para>
801            </listitem>
802        </varlistentry>
803
804        <varlistentry>
805            <term><envar>XML_CATALOG_FILES</envar></term>
806            <listitem>
807                <para><acronym>XML</acronym> catalog behavior can be changed by redirecting
808                    queries to the user's own set of catalogs. This can be done by setting
809                    the <envar>XML_CATALOG_FILES</envar> environment variable to a space-separated
810                    list of catalogs. Use percent-encoding to escape spaces or other characters.
811                    An empty variable should deactivate loading the default catalog.
812                </para>
813            </listitem>
814        </varlistentry>
815
816        <varlistentry>
817            <term><envar>XML_DEBUG_CATALOG</envar></term>
818            <listitem>
819                <para>Setting the environment variable <envar>XML_DEBUG_CATALOG</envar>
820                    to <parameter>non-zero</parameter> using the <command>export</command>
821                    command outputs debugging information related to catalog operations.
822                </para>
823            </listitem>
824        </varlistentry>
825
826        <varlistentry>
827            <term><envar>XMLLINT_INDENT</envar></term>
828            <listitem>
829                <para>Setting the environment variable <envar>XMLLINT_INDENT</envar>
830                    controls the indentation. The default value is two spaces &quot;  &quot;.
831                </para>
832            </listitem>
833        </varlistentry>
834
835    </variablelist>
836</refsect1>
837
838<refsect1 id="diagnostics">
839    <title>DIAGNOSTICS</title>
840    <para>
841        &xmllint; return codes provide information that can be used when
842        calling it from scripts.
843    </para>
844    <!-- better use segmentedlist element later,
845         which is currently only supported in snapshots -->
846    <variablelist>
847
848        <varlistentry>
849            <term><errorcode>0</errorcode></term>
850            <listitem>
851                <para>No error</para>
852            </listitem>
853        </varlistentry>
854
855        <varlistentry>
856            <term><errorcode>1</errorcode></term>
857            <listitem>
858                <para>Unclassified</para>
859            </listitem>
860        </varlistentry>
861
862        <varlistentry>
863            <term><errorcode>2</errorcode></term>
864            <listitem>
865                <para>Error in <acronym>DTD</acronym></para>
866            </listitem>
867        </varlistentry>
868
869        <varlistentry>
870            <term><errorcode>3</errorcode></term>
871            <listitem>
872                <para>Validation error</para>
873            </listitem>
874        </varlistentry>
875
876        <varlistentry>
877            <term><errorcode>4</errorcode></term>
878            <listitem>
879                <para>Validation error</para>
880            </listitem>
881        </varlistentry>
882
883        <varlistentry>
884            <term><errorcode>5</errorcode></term>
885            <listitem>
886                <para>Error in schema compilation</para>
887            </listitem>
888        </varlistentry>
889
890        <varlistentry>
891            <term><errorcode>6</errorcode></term>
892            <listitem>
893                <para>Error writing output</para>
894            </listitem>
895        </varlistentry>
896
897        <varlistentry>
898            <term><errorcode>7</errorcode></term>
899            <listitem>
900                <para>
901                    Error in pattern (generated when <option>--pattern</option> option is used)
902                </para>
903            </listitem>
904        </varlistentry>
905
906        <varlistentry>
907            <term><errorcode>9</errorcode></term>
908            <listitem>
909                <para>Out of memory error</para>
910            </listitem>
911        </varlistentry>
912
913        <varlistentry>
914            <term><errorcode>10</errorcode></term>
915            <listitem>
916                <para>XPath evaluation error</para>
917            </listitem>
918        </varlistentry>
919
920        <varlistentry>
921            <term><errorcode>11</errorcode></term>
922            <listitem>
923                <para>XPath result is empty</para>
924            </listitem>
925        </varlistentry>
926
927    </variablelist>
928</refsect1>
929
930<refsect1 id="seealso">
931    <title>SEE ALSO</title>
932    <para><citerefentry>
933            <refentrytitle>libxml</refentrytitle>
934            <manvolnum>3</manvolnum>
935        </citerefentry>
936    </para>
937    <para>
938        More information can be found at
939        <itemizedlist>
940            <listitem>
941                <para><citerefentry>
942                        <refentrytitle>libxml</refentrytitle>
943                        <manvolnum>3</manvolnum>
944                    </citerefentry> web page <ulink url="https://gitlab.gnome.org/GNOME/libxml2"/>
945                </para>
946            </listitem>
947        </itemizedlist>
948    </para>
949</refsect1>
950
951</refentry>
952