blob: 904e706a86437b6c62eb55911a44c89ea9e53245 [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 Veillardbf95fd22006-04-06 08:22:51 +000049 <date>2006-03-05</date>
50 <!-- 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>
133 The &xmllint; program parses one or more XML files, specified on the
134 command line as <replaceable>XML-FILE</replaceable> (or the standard
135 input if the filename provided is <emphasis role="bold">-</emphasis> ).
136 It prints various types of output, depending upon the options selected.
137 It is useful for detecting errors both
138 in <acronym>XML</acronym> code and in the <acronym>XML</acronym> parser
139 itself.
140 </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>
145 <para>More information can be found at
146 <itemizedlist>
147 <listitem>
148 <para><citerefentry>
149 <refentrytitle>libxml</refentrytitle>
150 <manvolnum>3</manvolnum>
151 </citerefentry> web page <ulink url="http://www.xmlsoft.org/"/>
152 </para>
153 </listitem>
154 <listitem>
155 <para>
156 W3C <acronym>XSLT</acronym> page <ulink url="http://www.w3.org/TR/xslt"/>
157 </para>
158 </listitem>
159 </itemizedlist>
Daniel Veillard961bfc12006-02-21 19:24:04 +0000160 </para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000161</refsect1>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000162
Daniel Veillard46f97212006-02-20 08:58:51 +0000163<refsect1 id="options">
164 <title>OPTIONS</title>
165 <para>
166 &xmllint; accepts the following options (in alphabetical order):
167 </para>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000168
Daniel Veillard46f97212006-02-20 08:58:51 +0000169 <variablelist>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000170
Daniel Veillard46f97212006-02-20 08:58:51 +0000171 <varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000172 <term><option>--auto</option></term>
173 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000174 <para>Generate a small document for testing purposes.</para>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000175 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000176 </varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000177
Daniel Veillard46f97212006-02-20 08:58:51 +0000178 <varlistentry>
179 <term><option>--catalogs</option></term>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000180 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000181 <para>
182 Use the catalogs from <envar>SGML_CATALOG_FILES</envar>.
183 Otherwise <filename>/etc/xml/catalog</filename> is used by default.
184 </para>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000185 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000186 </varlistentry>
187
188 <varlistentry>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000189 <term><option>--chkregister</option></term>
190 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000191 <para>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000192 Turn on node registration. Useful for developers testing <citerefentry>
193 <refentrytitle>libxml</refentrytitle>
194 <manvolnum>3</manvolnum>
195 </citerefentry> node tracking code.
Daniel Veillard46f97212006-02-20 08:58:51 +0000196 </para>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000197 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000198 </varlistentry>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000199
Daniel Veillard46f97212006-02-20 08:58:51 +0000200 <varlistentry>
201 <term><option>--compress</option></term>
202 <listitem>
203 <para>
204 Turn on <application>gzip</application> compression of output.
205 </para>
206 </listitem>
207 </varlistentry>
208
209 <varlistentry>
210 <term><option>--copy</option></term>
211 <listitem>
212 <para>Test the internal copy implementation.</para>
213 </listitem>
214 </varlistentry>
215
216 <varlistentry>
217 <term><option>--c14n</option></term>
218 <listitem>
219 <para>
220 Use the W3C XML Canonicalisation (<acronym>C14N</acronym>) to serialize
221 the result of parsing to <filename class="devicefile">stdout</filename>.
222 It keeps comments in the result.
223 </para>
224 </listitem>
225 </varlistentry>
226
227 <varlistentry>
228 <term><option>--dtdvalid <replaceable class="option">URL</replaceable></option></term>
229 <listitem>
230 <para>
231 Use the <acronym>DTD</acronym> specified by
232 an <replaceable>URL</replaceable> for validation.
233 </para>
234 </listitem>
235 </varlistentry>
236
237 <varlistentry>
238 <term><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></term>
239 <listitem>
240 <para>
241 Use the <acronym>DTD</acronym> specified by a Public
242 Identifier <replaceable>FPI</replaceable> for validation, note that this
243 will require a Catalog exporting that Public Identifier to work.
244 </para>
245 </listitem>
246 </varlistentry>
247
248 <varlistentry>
249 <term><option>--debug</option></term>
250 <listitem>
251 <para>
252 Parse a file and output an annotated tree of the
253 in-memory version of the document.
254 </para>
255 </listitem>
256 </varlistentry>
257
258 <varlistentry>
259 <term><option>--debugent</option></term>
260 <listitem>
261 <para>Debug the entities defined in the document.</para>
262 </listitem>
263 </varlistentry>
264
265 <varlistentry>
266 <term><option>--dropdtd</option></term>
267 <listitem>
268 <para>Remove <acronym>DTD</acronym> from output.</para>
269 </listitem>
270 </varlistentry>
271
272 <varlistentry>
273 <term><option>--dtdattr</option></term>
274 <listitem>
275 <para>
276 Fetch external <acronym>DTD</acronym> and populate the tree with
277 inherited attributes.
278 </para>
279 </listitem>
280 </varlistentry>
281
282 <varlistentry>
283 <term><option>--encode <replaceable class="option">ENCODING</replaceable></option></term>
284 <listitem>
285 <para>Output in the given encoding.</para>
286 </listitem>
287 </varlistentry>
288
289 <varlistentry>
290 <term><option>--format</option></term>
291 <listitem>
292 <para>
293 Reformat and reindent the output. The <envar>XMLLINT_INDENT</envar>
294 environment variable controls the indentation (default value is two
295 spaces &quot; &quot;).
296 </para>
297 </listitem>
298 </varlistentry>
299
300 <varlistentry>
301 <term><option>--help</option></term>
302 <listitem>
303 <para>Print out a short usage summary for &xmllint;.</para>
304 </listitem>
305 </varlistentry>
306
307 <varlistentry>
308 <term><option>--html</option></term>
309 <listitem>
310 <para>Use the <acronym>HTML</acronym> parser.</para>
311 </listitem>
312 </varlistentry>
313
314 <varlistentry>
315 <term><option>--htmlout</option></term>
316 <listitem>
317 <para>
318 Output results as an <acronym>HTML</acronym> file. This
319 causes &xmllint; to output the necessary <acronym>HTML</acronym>
320 tags surrounding the result tree output so the results can be
321 displayed/viewed in a browser.
322 </para>
323 </listitem>
324 </varlistentry>
325
326 <varlistentry>
327 <term><option>--insert</option></term>
328 <listitem>
329 <para>Test for valid insertions.</para>
330 </listitem>
331 </varlistentry>
332
333 <varlistentry>
334 <term><option>--loaddtd</option></term>
335 <listitem>
336 <para>Fetch external <acronym>DTD</acronym>.</para>
337 </listitem>
338 </varlistentry>
339
340 <varlistentry>
341 <term><option>--load-trace</option></term>
342 <listitem>
343 <para>
344 Display all the documents loaded during the processing
345 to <filename class="devicefile">stderr</filename>.
346 </para>
347 </listitem>
348 </varlistentry>
349
350 <varlistentry>
351 <term><option>--maxmem <replaceable class="option">NNBYTES</replaceable></option></term>
352 <listitem>
353 <para>
354 Test the parser memory support. <replaceable>NNBYTES</replaceable>
355 is the maximum number of bytes the library is allowed to allocate.
356 This can also be used to make sure batch processing
357 of <acronym>XML</acronym> files will not exhaust the virtual memory
358 of the server running them.
359 </para>
360 </listitem>
361 </varlistentry>
362
363 <varlistentry>
364 <term><option>--memory</option></term>
365 <listitem>
366 <para>Parse from memory.</para>
367 </listitem>
368 </varlistentry>
369
370 <varlistentry>
371 <term><option>--noblanks</option></term>
372 <listitem>
373 <para>Drop ignorable blank spaces.</para>
374 </listitem>
375 </varlistentry>
376
377 <varlistentry>
378 <term><option>--nocatalogs</option></term>
379 <listitem>
380 <para>Do not use any catalogs.</para>
381 </listitem>
382 </varlistentry>
383
384 <varlistentry>
385 <term><option>--nocdata</option></term>
386 <listitem>
387 <para>Substitute CDATA section by equivalent text nodes.</para>
388 </listitem>
389 </varlistentry>
390
391 <varlistentry>
392 <term><option>--noent</option></term>
393 <listitem>
394 <para>
395 Substitute entity values for entity references. By default, &xmllint;
396 leaves entity references in place.
397 </para>
398 </listitem>
399 </varlistentry>
400
401 <varlistentry>
402 <term><option>--nonet</option></term>
403 <listitem>
404 <para>
405 Do not use the Internet to fetch <acronym>DTD</acronym>s or entities.
406 </para>
407 </listitem>
408 </varlistentry>
409
410 <varlistentry>
411 <term><option>--noout</option></term>
412 <listitem>
413 <para>
414 Suppress output. By default, &xmllint; outputs the result tree.
415 </para>
416 </listitem>
417 </varlistentry>
418
419 <varlistentry>
420 <term><option>--nowarning</option></term>
421 <listitem>
422 <para>Do not emit warnings from the parser and/or validator.</para>
423 </listitem>
424 </varlistentry>
425
426 <varlistentry>
427 <term><option>--nowrap</option></term>
428 <listitem>
429 <para>Do not output <acronym>HTML</acronym> doc wrapper.</para>
430 </listitem>
431 </varlistentry>
432
433 <varlistentry>
434 <term><option>--noxincludenode</option></term>
435 <listitem>
436 <para>
437 Do XInclude processing but do not generate XInclude start and end nodes.
438 </para>
439 </listitem>
440 </varlistentry>
441
442 <varlistentry>
443 <term><option>--nsclean</option></term>
444 <listitem>
445 <para>Remove redundant namespace declarations.</para>
446 </listitem>
447 </varlistentry>
448
449 <varlistentry>
450 <term><option>--output <replaceable class="option">FILE</replaceable></option></term>
451 <listitem>
452 <para>
453 Define a file path where &xmllint; will save the result of parsing.
454 Usually the programs build a tree and save it
455 on <filename class="devicefile">stdout</filename>, with this option
456 the result <acronym>XML</acronym> instance will be saved onto a file.
457 </para>
458 </listitem>
459 </varlistentry>
460
461 <varlistentry>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000462 <term><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></term>
Daniel Veillard46f97212006-02-20 08:58:51 +0000463 <listitem>
464 <para>
465 Use the (space- or colon-separated) list of filesystem paths specified
466 by <replaceable>PATHS</replaceable> to load <acronym>DTD</acronym>s or
467 entities. Enclose space-separated lists by quotation marks.
468 </para>
469 </listitem>
470 </varlistentry>
471
472 <varlistentry>
473 <term><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></term>
474 <listitem>
475 <para>
476 Used to exercise the pattern recognition engine, which can be used
477 with the reader interface to the parser. It allows to select some
478 nodes in the document based on an XPath (subset) expression. Used
479 for debugging.
480 </para>
481 </listitem>
482 </varlistentry>
483
484 <varlistentry>
485 <term><option>--postvalid</option></term>
486 <listitem>
487 <para>Validate after parsing is completed.</para>
488 </listitem>
489 </varlistentry>
490
491 <varlistentry>
492 <term><option>--push</option></term>
493 <listitem>
494 <para>Use the push mode of the parser.</para>
495 </listitem>
496 </varlistentry>
497
498 <varlistentry>
499 <term><option>--recover</option></term>
500 <listitem>
501 <para>Output any parsable portions of an invalid document.</para>
502 </listitem>
503 </varlistentry>
504
505 <varlistentry>
506 <term><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></term>
507 <listitem>
508 <para>
509 Use RelaxNG file named <replaceable class="option">SCHEMA</replaceable>
510 for validation.
511 </para>
512 </listitem>
513 </varlistentry>
514
515 <varlistentry>
516 <term><option>--repeat</option></term>
517 <listitem>
518 <para>Repeat 100 times, for timing or profiling.</para>
519 </listitem>
520 </varlistentry>
521
522 <varlistentry>
523 <term><option>--schema <replaceable>SCHEMA</replaceable></option></term>
524 <listitem>
525 <para>
526 Use a W3C XML Schema file named <replaceable>SCHEMA</replaceable>
527 for validation.
528 </para>
529 </listitem>
530 </varlistentry>
531
532 <varlistentry>
533 <term><option>--shell</option></term>
534 <listitem>
535 <para>
536 Run a navigating shell. Details on available commands in shell mode
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000537 are below (see <xref linkend="shell"/>).
Daniel Veillard46f97212006-02-20 08:58:51 +0000538 </para>
539 </listitem>
540 </varlistentry>
541
542 <varlistentry>
543 <term><option>--stream</option></term>
544 <listitem>
545 <para>
546 Use streaming API - useful when used in combination
547 with <option>--relaxng</option> or <option>--valid</option> options
548 for validation of files that are too large to be held in memory.
549 </para>
550 </listitem>
551 </varlistentry>
552
553 <varlistentry>
554 <term><option>--testIO</option></term>
555 <listitem>
556 <para>Test user input/output support.</para>
557 </listitem>
558 </varlistentry>
559
560 <varlistentry>
561 <term><option>--timing</option></term>
562 <listitem>
563 <para>
564 Output information about the time it takes &xmllint; to perform the
565 various steps.
566 </para>
567 </listitem>
568 </varlistentry>
569
570 <varlistentry>
571 <term><option>--valid</option></term>
572 <listitem>
573 <para>
574 Determine if the document is a valid instance of the included
575 Document Type Definition (<acronym>DTD</acronym>).
576 A <acronym>DTD</acronym> to be validated against also can be
577 specified at the command line using the <option>--dtdvalid</option>
578 option. By default, &xmllint; also checks to determine if the
579 document is well-formed.
580 </para>
581 </listitem>
582 </varlistentry>
583
584 <varlistentry>
585 <term><option>--version</option></term>
586 <listitem>
587 <para>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000588 Display the version of <citerefentry>
589 <refentrytitle>libxml</refentrytitle>
590 <manvolnum>3</manvolnum>
591 </citerefentry> used.
Daniel Veillard46f97212006-02-20 08:58:51 +0000592 </para>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry>
597 <term><option>--walker</option></term>
598 <listitem>
599 <para>
600 Test the walker module, which is a reader interface but for a
601 document tree, instead of using the reader <acronym>API</acronym> on
602 an unparsed document it works on a existing in-memory tree. Used in
603 debugging.
604 </para>
605 </listitem>
606 </varlistentry>
607
608 <varlistentry>
609 <term><option>--xinclude</option></term>
610 <listitem>
611 <para>Do XInclude processing.</para>
612 </listitem>
613 </varlistentry>
614
615 <varlistentry>
616 <term><option>--xmlout</option></term>
617 <listitem>
618 <para>
619 Used in conjunction with <option>--html</option>. Usually
620 when <acronym>HTML</acronym> is parsed the document is saved with
621 the <acronym>HTML</acronym> serializer, but with this option the
622 resulting document is saved with the <acronym>XML</acronym>
623 serializer. This is primarily used to
624 generate <acronym>XHTML</acronym>
625 from <acronym>HTML</acronym> input.
626 </para>
627 </listitem>
628 </varlistentry>
629
630 </variablelist>
631</refsect1>
632
633<refsect1 id="shell">
634 <title>SHELL COMMANDS</title>
635 <para>
636 &xmllint; offers an interactive shell mode invoked with
637 the <option>--shell</option> command. Available commands in shell mode
638 include (in alphabetical order):
639 </para>
640 <variablelist>
641
642 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000643 <term><command>base</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000644 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000645 <para>Display <acronym>XML</acronym> base of the node.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000646 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000647 </varlistentry>
648
649 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000650 <term><command>bye</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000651 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000652 <para>Leave the shell.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000653 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000654 </varlistentry>
655
656 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000657 <term><command>cat <replaceable>NODE</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000658 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000659 <para>Display the given node or the current one.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000660 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000661 </varlistentry>
662
663 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000664 <term><command>cd <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000665 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000666 <para>
667 Change the current node to the given path (if unique) or root if no
668 argument is given.
669 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000670 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000671 </varlistentry>
672
673 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000674 <term><command>dir <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000675 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000676 <para>
677 Dumps information about the node (namespace, attributes, content).
678 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000679 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000680 </varlistentry>
681
682 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000683 <term><command>du <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000684 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000685 <para>
686 Show the structure of the subtree under the given path or the current node.
687 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000688 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000689 </varlistentry>
690
691 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000692 <term><command>exit</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000693 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000694 <para>Leave the shell.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000695 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000696 </varlistentry>
697
698 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000699 <term><command>help</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000700 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000701 <para>Show this help.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000702 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000703 </varlistentry>
704
705 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000706 <term><command>free</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000707 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000708 <para>Display memory usage.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000709 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000710 </varlistentry>
711
712 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000713 <term><command>load <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000714 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000715 <para>Load a new document with the given filename.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000716 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000717 </varlistentry>
718
719 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000720 <term><command>ls <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000721 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000722 <para>List contents of the given path or the current directory.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000723 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000724 </varlistentry>
725
726 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000727 <term><command>pwd</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000728 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000729 <para>Display the path to the current node.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000730 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000731 </varlistentry>
732
733 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000734 <term><command>quit</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000735 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000736 <para>Leave the shell.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000737 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000738 </varlistentry>
739
740 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000741 <term><command>save <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000742 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000743 <para>
744 Save the current document to the given filename or to the original name.
745 </para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000746 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000747 </varlistentry>
748
749 <varlistentry>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000750 <term><option>validate</option></term>
751 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000752 <para>Check the document for errors.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000753 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000754 </varlistentry>
755
756 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000757 <term><command>write <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000758 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000759 <para>Write the current node to the given filename.</para>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000760 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000761 </varlistentry>
762
763 </variablelist>
764</refsect1>
765
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000766<refsect1 id="environment">
Daniel Veillard46f97212006-02-20 08:58:51 +0000767 <title>ENVIRONMENT</title>
768 <variablelist>
769
770 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000771 <term><envar>SGML_CATALOG_FILES</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000772 <listitem>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000773 <para>to be written ...</para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000774 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000775 </varlistentry>
776
777 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000778 <term><envar>XML_CATALOG_FILES</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000779 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000780 <para>
781 Catalog behavior can be changed by redirecting queries to the user's
782 own set of catalogs. This can be done by setting
783 the <envar>XML_CATALOG_FILES</envar> environment variable to a list
784 of catalogs. An empty one should deactivate loading the
785 default <filename>/etc/xml/catalog</filename> default catalog.
786 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000787 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000788 </varlistentry>
789
790 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000791 <term><envar>XML_DEBUG_CATALOG</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000792 <listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000793 <para>
794 Setting the environment variable <envar>XML_DEBUG_CATALOG</envar>
795 using the <command>export</command> command outputs debugging information
796 related to catalog operations.
797 </para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000798 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000799 </varlistentry>
800
801 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000802 <term><envar>XMLLINT_INDENT</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000803 <listitem>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000804 <para>to be written ...</para>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000805 </listitem>
Daniel Veillard46f97212006-02-20 08:58:51 +0000806 </varlistentry>
807
808 </variablelist>
809</refsect1>
810
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000811<refsect1 id="diagnostics">
Daniel Veillard46f97212006-02-20 08:58:51 +0000812 <title>DIAGNOSTICS</title>
813 <para>
814 On the completion of execution, &xmllint; returns the following error codes:
815 </para>
Daniel Veillard1589e8d2006-04-06 12:57:09 +0000816 <!-- better use segmentedlist element later,
817 which is currently only supported in snapshots -->
818 <variablelist>
819
820 <varlistentry>
821 <term><errorcode>0</errorcode></term>
822 <listitem>
823 <para>No error</para>
824 </listitem>
825 </varlistentry>
826
827 <varlistentry>
828 <term><errorcode>1</errorcode></term>
829 <listitem>
830 <para>Unclassified</para>
831 </listitem>
832 </varlistentry>
833
834 <varlistentry>
835 <term><errorcode>2</errorcode></term>
836 <listitem>
837 <para>Error in <acronym>DTD</acronym></para>
838 </listitem>
839 </varlistentry>
840
841 <varlistentry>
842 <term><errorcode>3</errorcode></term>
843 <listitem>
844 <para>Validation error</para>
845 </listitem>
846 </varlistentry>
847
848 <varlistentry>
849 <term><errorcode>4</errorcode></term>
850 <listitem>
851 <para>Validation error</para>
852 </listitem>
853 </varlistentry>
854
855 <varlistentry>
856 <term><errorcode>5</errorcode></term>
857 <listitem>
858 <para>Error in schema compilation</para>
859 </listitem>
860 </varlistentry>
861
862 <varlistentry>
863 <term><errorcode>6</errorcode></term>
864 <listitem>
865 <para>Error writing output</para>
866 </listitem>
867 </varlistentry>
868
869 <varlistentry>
870 <term><errorcode>7</errorcode></term>
871 <listitem>
872 <para>
873 Error in pattern (generated when <option>--pattern</option> option is used)
874 </para>
875 </listitem>
876 </varlistentry>
877
878 <varlistentry>
879 <term><errorcode>8</errorcode></term>
880 <listitem>
881 <para>
882 Error in Reader registration (generated
883 when <option>--chkregister</option> option is used)
884 </para>
885 </listitem>
886 </varlistentry>
887
888 <varlistentry>
889 <term><errorcode>9</errorcode></term>
890 <listitem>
891 <para>Out of memory error</para>
892 </listitem>
893 </varlistentry>
894
895 </variablelist>
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000896</refsect1>
Daniel Veillard46f97212006-02-20 08:58:51 +0000897
Daniel Veillardbf95fd22006-04-06 08:22:51 +0000898<refsect1 id="seealso">
899 <title>SEE ALSO</title>
900 <para>
901 <citerefentry>
902 <refentrytitle>libxml</refentrytitle>
903 <manvolnum>3</manvolnum>
904 </citerefentry>
905 </para>
Daniel Veillard46f97212006-02-20 08:58:51 +0000906</refsect1>
907
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000908</refentry>