blob: 10f5d827c7515c73dcf92d6c3563597efdb771e5 [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]>
9<refentry>
10 <refentryinfo>
11 <title>xmllint Manual</title>
12 <copyright>
13 <year>2001</year>
14 </copyright>
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000015 <copyright>
16 <year>2004</year>
17 </copyright>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000018 <author>
19 <firstname>John</firstname>
20 <surname>Fleck</surname>
21 </author>
22 <address><email>jfleck@inkstain.net</email></address>
23 <author>
24 <firstname>Ziying</firstname>
25 <surname>Sherwin</surname>
26 </author>
27 <address><email>sherwin@nlm.nih.gov</email></address>
MST 2001 John Fleck42304042001-11-18 00:18:06 +000028 <author>
29 <firstname>Heiko</firstname>
30 <surname>Rupp</surname>
31 </author>
32 <address><email>hwr@pilhuhn.de</email></address>
MST 2001 John Fleck3fc555e2001-12-11 04:41:24 +000033
John Fleck3cbaa6d2004-08-15 00:47:45 +000034 <releaseinfo>This is release 0.5 of the xmllint Manual.</releaseinfo>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000035 </refentryinfo>
36
37 <refmeta>
38 <refentrytitle>xmllint</refentrytitle>
39 <manvolnum>1</manvolnum>
40 </refmeta>
41
42 <refnamediv>
43 <refname>xmllint</refname>
44 <refpurpose>command line <acronym>XML</acronym> tool</refpurpose>
45 </refnamediv>
46
47 <refsynopsisdiv>
48 <cmdsynopsis>
49 <command>xmllint</command>
Daniel Veillard6464d6a2006-02-19 21:35:39 +000050 <group choice="opt">
51 <arg choice="plain"><option>--version</option></arg>
52 <arg choice="plain"><option>--debug</option></arg>
53 <arg choice="plain"><option>--shell</option></arg>
54 <arg choice="plain"><option>--debugent</option></arg>
55 <arg choice="plain"><option>--copy</option></arg>
56 <arg choice="plain"><option>--recover</option></arg>
57 <arg choice="plain"><option>--noent</option></arg>
58 <arg choice="plain"><option>--noout</option></arg>
59 <arg choice="plain"><option>--nonet</option></arg>
60 <arg choice="plain"><option>--path "<replaceable class="option">PATHS</replaceable>"</option></arg>
61 <arg choice="plain"><option>--load-trace</option></arg>
62 <arg choice="plain"><option>--htmlout</option></arg>
63 <arg choice="plain"><option>--nowrap</option></arg>
64 <arg choice="plain"><option>--valid</option></arg>
65 <arg choice="plain"><option>--postvalid</option></arg>
66 <arg choice="plain"><option>--dtdvalid <replaceable class="option">URL</replaceable></option></arg>
67 <arg choice="plain"><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></arg>
68 <arg choice="plain"><option>--timing</option></arg>
69 <arg choice="plain"><option>--output <replaceable class="option">FILE</replaceable></option></arg>
70 <arg choice="plain"><option>--repeat</option></arg>
71 <arg choice="plain"><option>--insert</option></arg>
72 <arg choice="plain"><option>--compress</option></arg>
73 <arg choice="plain"><option>--html</option></arg>
74 <arg choice="plain"><option>--xmlout</option></arg>
75 <arg choice="plain"><option>--push</option></arg>
76 <arg choice="plain"><option>--memory</option></arg>
77 <arg choice="plain"><option>--maxmem <replaceable class="option">NBBYTES</replaceable></option></arg>
78 <arg choice="plain"><option>--nowarning</option></arg>
79 <arg choice="plain"><option>--noblanks</option></arg>
80 <arg choice="plain"><option>--nocdata</option></arg>
81 <arg choice="plain"><option>--format</option></arg>
82 <arg choice="plain"><option>--encode <replaceable class="option">ENCODING</replaceable></option></arg>
83 <arg choice="plain"><option>--dropdtd</option></arg>
84 <arg choice="plain"><option>--nsclean</option></arg>
85 <arg choice="plain"><option>--testIO</option></arg>
86 <arg choice="plain"><option>--catalogs</option></arg>
87 <arg choice="plain"><option>--nocatalogs</option></arg>
88 <arg choice="plain"><option>--auto</option></arg>
89 <arg choice="plain"><option>--xinclude</option></arg>
90 <arg choice="plain"><option>--noxincludenode</option></arg>
91 <arg choice="plain"><option>--loaddtd</option></arg>
92 <arg choice="plain"><option>--dtdattr</option></arg>
93 <arg choice="plain"><option>--stream</option></arg>
94 <arg choice="plain"><option>--walker</option></arg>
95 <arg choice="plain"><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></arg>
96 <arg choice="plain"><option>--chkregister</option></arg>
97 <arg choice="plain"><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></arg>
98 <arg choice="plain"><option>--schema <replaceable class="option">SCHEMA</replaceable></option></arg>
99 <arg choice="plain"><option>--c14n</option></arg>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000100 </group>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000101 <arg choice="req" rep="repeat"><replaceable>XML-FILE(S)</replaceable></arg>
102 </cmdsynopsis>
103 <cmdsynopsis>
104 <command>xmllint</command>
105 <arg choice="plain"><option>--help</option></arg>
106 </cmdsynopsis>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000107 </refsynopsisdiv>
108
109 <refsect1 id="introduction">
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000110 <title>DESCRIPTION</title>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000111 <para>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000112 The &xmllint; program parses one or more XML files, specified on the
113 command line as <replaceable>XML-FILE</replaceable> (or the standard
Daniel Veillarde44aafb2004-10-29 12:18:43 +0000114 input if the filename provided is - ). It prints various
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000115 types of output, depending upon the options selected. It is useful for
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000116 detecting errors both in <acronym>XML</acronym> code and in
117 the <acronym>XML</acronym> parser itself.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000118 </para>
119
120 <para>
121 It is included in <application>libxml2</application>.
122 </para>
123 </refsect1>
124 <refsect1 id="options">
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000125 <title>OPTIONS</title>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000126 <variablelist>
127 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000128 <term><option>--help</option></term>
129 <listitem>
130 <simpara>Print out a a short usage summary for &xmllint;.</simpara>
131 </listitem>
132 </varlistentry>
133
134 <varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000135 <term><option>--version</option></term>
136 <listitem>
137 <simpara>
138 Display the version of
139 <application>libxml2</application> used.
140 </simpara>
141 </listitem>
142 </varlistentry>
143
144 <varlistentry>
145 <term><option>--debug</option></term>
146 <listitem>
147 <simpara>
148 Parse a file and output an annotated tree of the
149 in-memory version of the document.
150 </simpara>
151 </listitem>
152 </varlistentry>
153
154 <varlistentry>
155 <term><option>--shell</option></term>
156 <listitem>
157 <simpara>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000158 Run a navigating shell. Details on available commands in shell mode
159 are below.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000160 </simpara>
161 </listitem>
162 </varlistentry>
163
164 <varlistentry>
165 <term><option>--debugent</option></term>
166 <listitem>
167 <simpara>
168 Debug the entities defined in the document.
169 </simpara>
170 </listitem>
171 </varlistentry>
172
173 <varlistentry>
174 <term><option>--copy</option> </term>
175 <listitem>
176 <simpara>
177 Test the internal copy implementation.
178 </simpara>
179 </listitem>
180 </varlistentry>
181
182
183 <varlistentry>
184 <term><option>--recover</option></term>
185 <listitem>
186 <simpara>
187 Output any parsable portions of an invalid
188 document.
189 </simpara>
190 </listitem>
191 </varlistentry>
192
193 <varlistentry>
194 <term><option>--noent</option></term>
195 <listitem>
196 <simpara>
197 Substitute entity values for entity
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000198 references. By default, &xmllint; leaves entity
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000199 references in place.
200 </simpara>
201 </listitem>
202 </varlistentry>
203
204 <varlistentry>
Daniel Veillarddca8cc72003-09-26 13:53:14 +0000205 <term><option>--nocdata</option></term>
206 <listitem>
207 <simpara>
208 Substitute CDATA section by equivalent text nodes.
209 </simpara>
210 </listitem>
211 </varlistentry>
212
213 <varlistentry>
214 <term><option>--nsclean</option></term>
215 <listitem>
216 <simpara>
217 Remove redundant namespace declarations.
218 </simpara>
219 </listitem>
220 </varlistentry>
221
222 <varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000223 <term><option>--noout</option></term>
224 <listitem>
225 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000226 Suppress output. By default, &xmllint;
227 outputs the result tree.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000228 </simpara>
229 </listitem>
230 </varlistentry>
231
Daniel Veillard0bff36d2004-08-31 09:37:03 +0000232 <varlistentry>
233 <term><option>--nonet</option></term>
234 <listitem>
235 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000236 Do not use the Internet to fetch <acronym>DTD</acronym>s or entities.
Daniel Veillard0bff36d2004-08-31 09:37:03 +0000237 </simpara>
238 </listitem>
239 </varlistentry>
240
241 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000242 <term> <option>--path</option> "<replaceable class="option">PATHS</replaceable>"</term>
Daniel Veillard0bff36d2004-08-31 09:37:03 +0000243 <listitem>
244 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000245 Use the list (separated by space or colon) of filesystem path
246 specified by <replaceable>PATHS</replaceable> to
247 load <acronym>DTD</acronym>s or entities .
Daniel Veillard0bff36d2004-08-31 09:37:03 +0000248 </simpara>
249 </listitem>
250 </varlistentry>
251
252 <varlistentry>
253 <term><option>--load-trace</option></term>
254 <listitem>
255 <simpara>
256 Display to stderr all the documents loaded during the processing.
257 </simpara>
258 </listitem>
259 </varlistentry>
260
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000261 <varlistentry>
262 <term><option>--htmlout</option></term>
263 <listitem>
264 <simpara>
265 Output results as an <acronym>HTML</acronym>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000266 file. This causes &xmllint; to output
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000267 the necessary <acronym>HTML</acronym> tags surrounding the result tree
268 output so the results can be displayed in a browser.
269 </simpara>
270 </listitem>
271 </varlistentry>
272
273 <varlistentry>
274 <term><option>--nowrap </option></term>
275 <listitem>
276 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000277 Do not output <acronym>HTML</acronym> doc wrapper.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000278 </simpara>
279 </listitem>
280 </varlistentry>
281
282<varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000283 <term><option>--valid</option></term>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000284 <listitem>
285 <simpara>
286 Determine if the document is a valid instance
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000287 of the included Document Type Definition (<acronym>DTD</acronym>).
288 A <acronym>DTD</acronym> to be validated against also can be specified at
289 the command line using the <option>--dtdvalid</option> option. By
290 default, &xmllint; also checks to determine if the
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000291 document is well-formed.
292 </simpara>
293 </listitem>
294 </varlistentry>
295
296 <varlistentry>
297 <term><option>--postvalid</option></term>
298 <listitem>
299 <simpara>
300 Validate after parsing is completed.
301 </simpara>
302 </listitem>
303 </varlistentry>
304
305 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000306 <term> <option>--dtdvalid</option> <replaceable class="option">URL</replaceable></term>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000307 <listitem>
308 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000309 Use the <acronym>DTD</acronym>
310 specified by <replaceable>URL</replaceable> for
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000311 validation.
312 </simpara>
313 </listitem>
314 </varlistentry>
315
Daniel Veillard66f68e72003-08-18 16:39:51 +0000316 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000317 <term> <option>--dtdvalidfpi</option> <replaceable class="option">FPI</replaceable></term>
Daniel Veillard66f68e72003-08-18 16:39:51 +0000318 <listitem>
319 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000320 Use the <acronym>DTD</acronym>
321 specified by the Public Identifier <replaceable>FPI</replaceable>
322 for validation, note that this
Daniel Veillard66f68e72003-08-18 16:39:51 +0000323 will require a Catalog exporting that Public Identifier to work.
324 </simpara>
325 </listitem>
326 </varlistentry>
327
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000328 <varlistentry>
329 <term><option>--timing</option></term>
330 <listitem>
331 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000332 Output information about the time it takes &xmllint;
333 to perform the various steps.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000334 </simpara>
335 </listitem>
336 </varlistentry>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000337 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000338 <term><option>--output</option> <replaceable class="option">FILE</replaceable></term>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000339 <listitem>
340 <simpara>Define a file path where xmllint will save the result of
341 parsing. Usually the programs build a tree and save it on stdout, with
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000342 this option the result <acronym>XML</acronym> instance will be saved onto
343 a file.</simpara>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000344 </listitem>
345 </varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000346 <varlistentry>
347 <term><option>--repeat</option></term>
348 <listitem>
349 <simpara>
350 Repeat 100 times, for timing or profiling.
351 </simpara>
352 </listitem>
353 </varlistentry>
354
355 <varlistentry>
356 <term><option>--insert</option></term>
357 <listitem>
358 <simpara>
359 Test for valid insertions.
360 </simpara>
361 </listitem>
362 </varlistentry>
363
364 <varlistentry>
365 <term><option>--compress</option></term>
366 <listitem>
367 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000368 Turn on <application>gzip</application> compression of output.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000369 </simpara>
370 </listitem>
371 </varlistentry>
372
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000373 <varlistentry>
374 <term><option>--html</option></term>
375 <listitem>
376 <simpara>
377 Use the <acronym>HTML</acronym> parser.
378 </simpara>
379 </listitem>
380 </varlistentry>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000381 <varlistentry>
382 <term><option>--xmlout</option></term>
383 <listitem>
Daniel Veillardf10ae122005-07-10 19:03:16 +0000384 <simpara>Used in conjunction with <option>--html</option>. Usually
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000385 when <acronym>HTML</acronym> is parsed the document is saved with
386 the <acronym>HTML</acronym> serializer, but with this option the resulting
387 document is saved with the <acronym>XML</acronym> serializer. This is
388 primarily used to generate <acronym>XHTML</acronym>
389 from <acronym>HTML</acronym> input.</simpara>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000390 </listitem>
391 </varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000392 <varlistentry>
393 <term><option>--push</option></term>
394 <listitem>
395 <simpara>
396 Use the push mode of the parser.
397 </simpara>
398 </listitem>
399 </varlistentry>
400
401
402 <varlistentry>
403 <term><option>--memory</option></term>
404 <listitem>
405 <simpara>
406 Parse from memory.
407 </simpara>
408 </listitem>
409 </varlistentry>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000410 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000411 <term><option>--maxmem</option> <replaceable class="option">NNBYTES</replaceable></term>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000412 <listitem>
413 <simpara>Test the parser memory
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000414 support. <replaceable>NNBYTES</replaceable> is the maximum number of bytes the
John Fleck3cbaa6d2004-08-15 00:47:45 +0000415 library is allowed to allocate. This can also be used to make sure batch
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000416 processing of <acronym>XML</acronym> files will not exhaust the virtual memory
417 of the server running them.</simpara>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000418 </listitem>
419 </varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000420 <varlistentry>
421 <term><option>--nowarning</option></term>
422 <listitem>
423 <simpara>
424 Do not emit warnings from the parser and/or validator.
425 </simpara>
426 </listitem>
427 </varlistentry>
428
429 <varlistentry>
430 <term><option>--noblanks</option></term>
431 <listitem>
432 <simpara>
433 Drop ignorable blank spaces.
434 </simpara>
435 </listitem>
436 </varlistentry>
437
438 <varlistentry>
439 <term><option>--format</option></term>
440 <listitem>
441 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000442 Reformat and reindent the output. The <envar>XMLLINT_INDENT</envar>
Aleksey Sanin693c9bc2003-03-09 22:36:52 +0000443 environment variable controls the indentation (default
Daniel Veillarddc07e182003-04-25 10:39:38 +0000444 value is two spaces &quot; &quot;).
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000445 </simpara>
446 </listitem>
447 </varlistentry>
448
449 <varlistentry>
450 <term><option>--testIO</option></term>
451 <listitem>
452 <simpara>
453 Test user input/output support.
454 </simpara>
455 </listitem>
456 </varlistentry>
457
458 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000459 <term><option>--encode</option> <replaceable class="option">ENCODING</replaceable></term>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000460 <listitem>
461 <simpara>
462 Output in the given encoding.
463 </simpara>
464 </listitem>
465 </varlistentry>
466
467 <varlistentry>
468 <term><option>--catalogs</option></term>
469 <listitem>
470 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000471 Use the catalogs from <envar>SGML_CATALOG_FILES</envar>.
472 Otherwise <filename>/etc/xml/catalog</filename>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000473 is used by default.
474 </simpara>
475 </listitem>
476 </varlistentry>
477
478 <varlistentry>
479 <term><option>--nocatalogs</option></term>
480 <listitem>
481 <simpara>
482 Do not use any catalogs.
483 </simpara>
484 </listitem>
485 </varlistentry>
486
487 <varlistentry>
488 <term><option>--auto</option></term>
489 <listitem>
490 <simpara>
491 Generate a small document for testing purposes.
492 </simpara>
493 </listitem>
494 </varlistentry>
495
496 <varlistentry>
497 <term><option>--xinclude</option></term>
498 <listitem>
499 <simpara>
500 Do XInclude processing.
501 </simpara>
502 </listitem>
503 </varlistentry>
504 <varlistentry>
Daniel Veillardc14c3892004-08-16 12:34:50 +0000505 <term><option>--noxincludenode</option></term>
506 <listitem>
507 <simpara>
508 Do XInclude processing but do not generate XInclude start and end
509 nodes.
510 </simpara>
511 </listitem>
512 </varlistentry>
513 <varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000514 <term><option>--loaddtd</option></term>
515 <listitem>
516 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000517 Fetch external <acronym>DTD</acronym>.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000518 </simpara>
519 </listitem>
520 </varlistentry>
521
522 <varlistentry>
523 <term><option>--dtdattr</option></term>
524 <listitem>
525 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000526 Fetch external <acronym>DTD</acronym> and populate the tree with
527 inherited attributes.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000528 </simpara>
529 </listitem>
530 </varlistentry>
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000531 <varlistentry>
532 <term><option>--dropdtd</option></term>
533 <listitem>
534 <simpara>
535 Remove <acronym>DTD</acronym> from output.
536 </simpara>
537 </listitem>
538 </varlistentry>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000539 <varlistentry>
540 <term><option>--stream</option></term>
541 <listitem>
MDT 2003 John Fleck83c8a5c2003-04-20 16:45:07 +0000542 <simpara>Use streaming API - useful when used in combination with
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000543 <option>--relaxng</option> or <option>--valid</option> options
544 for validation of files that are
MDT 2003 John Fleck83c8a5c2003-04-20 16:45:07 +0000545 too large to be held in memory.</simpara>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000546 </listitem>
547 </varlistentry>
548 <varlistentry>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000549 <term><option>--walker</option></term>
550 <listitem>
551 <simpara>Test the walker module, which is a reader interface but for a
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000552 document tree, instead of using the reader <acronym>API</acronym> on an
553 unparsed document it works on a existing in-memory tree. Used in
554 debugging.</simpara>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000555 </listitem>
556 </varlistentry>
557 <varlistentry>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000558 <term><option>--chkregister</option></term>
559 <listitem>
Daniel Veillardda3b29a2004-08-14 11:15:13 +0000560 <simpara>Turn on node registration. Useful for developers testing
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000561 <application>libxml2</application> node tracking code.</simpara>
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000562 </listitem>
563 </varlistentry>
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000564 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000565 <term><option>--pattern</option> <replaceable class="option">PATTERNVALUE</replaceable></term>
John Fleck3cbaa6d2004-08-15 00:47:45 +0000566 <listitem>
567 <simpara>Used to exercise the pattern recognition engine, which can be
568 used with the reader interface to the parser. It allows to select some
569 nodes in the document based on an XPath (subset) expression. Used for
570 debugging.</simpara>
571 </listitem>
572 </varlistentry>
573 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000574 <term><option>--relaxng</option> <replaceable class="option">SCHEMA</replaceable></term>
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000575 <listitem>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000576 <simpara>Use RelaxNG file named <replaceable class="option">SCHEMA</replaceable> for
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000577 validation.</simpara>
578 </listitem>
579 </varlistentry>
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000580 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000581 <term><option>--schema</option> <replaceable>SCHEMA</replaceable></term>
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000582 <listitem>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000583 <simpara>Use a W3C XML Schema file named <replaceable>SCHEMA</replaceable>
584 for validation.</simpara>
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000585 </listitem>
586 </varlistentry>
587 <varlistentry>
588 <term>
Daniel Veillard29b17482004-08-16 00:39:03 +0000589 <option>--c14n</option></term>
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000590 <listitem>
Daniel Veillard29b17482004-08-16 00:39:03 +0000591 <simpara>Use the W3C XML Canonicalisation (C14N) to
MDT 2004 John Fleckb1b3a772004-08-19 13:45:47 +0000592serialize the result of parsing to stdout. It keeps comments in
593the result.</simpara>
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000594 </listitem>
595 </varlistentry>
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000596 </variablelist>
597 </refsect1>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000598
599 <refsect1 id="shell">
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000600 <title>SHELL COMMANDS</title>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000601 <para>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000602 &xmllint; offers an interactive shell mode
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000603 invoked with the <option>--shell</option> command. Available commands in
604 shell mode include:
605 </para>
606 <variablelist>
607 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000608 <term><command>base</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000609 <listitem>
610 <simpara>
611 display XML base of the node
612 </simpara>
613 </listitem>
614 </varlistentry>
615 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000616 <term><command>bye</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000617 <listitem>
618 <simpara>
619 leave shell
620 </simpara>
621 </listitem>
622 </varlistentry>
623 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000624 <term><command>cat <replaceable>NODE</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000625 <listitem>
626 <simpara>
627 Display node if given or current node.
628 </simpara>
629 </listitem>
630 </varlistentry>
631 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000632 <term><command>cd <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000633 <listitem>
634 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000635 Change the current node to <replaceable>PATH</replaceable> (if given
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000636 and unique) or root if no argument given.
637 </simpara>
638 </listitem>
639 </varlistentry>
640 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000641 <term><command>dir <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000642 <listitem>
643 <simpara>
644 Dumps information about the node (namespace, attributes, content).
645 </simpara>
646 </listitem>
647 </varlistentry>
648 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000649 <term><command>du <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000650 <listitem>
651 <simpara>
652 Show the structure of the subtree under path or the current node.
653 </simpara>
654 </listitem>
655 </varlistentry>
656 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000657 <term><command>exit</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000658 <listitem>
659 <simpara>
660 Leave the shell.
661 </simpara>
662 </listitem>
663 </varlistentry>
664 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000665 <term><command>help</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000666 <listitem>
667 <simpara>
668 Show this help.
669 </simpara>
670 </listitem>
671 </varlistentry>
672 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000673 <term><command>free</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000674 <listitem>
675 <simpara>
676 Display memory usage.
677 </simpara>
678 </listitem>
679 </varlistentry>
680 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000681 <term><command>load <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000682 <listitem>
683 <simpara>
684 Load a new document with the given name.
685 </simpara>
686 </listitem>
687 </varlistentry>
688 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000689 <term><command>ls <replaceable>PATH</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000690 <listitem>
691 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000692 List contents of <replaceable>PATH</replaceable> (if given) or the
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000693 current directory.
694 </simpara>
695 </listitem>
696 </varlistentry>
697 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000698 <term><command>pwd</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000699 <listitem>
700 <simpara>
701 Display the path to the current node.
702 </simpara>
703 </listitem>
704 </varlistentry>
705 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000706 <term><command>quit</command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000707 <listitem>
708 <simpara>
709 Leave the shell.
710 </simpara>
711 </listitem>
712 </varlistentry>
713 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000714 <term><command>save <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000715 <listitem>
716 <simpara>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000717 Saves the current document to <replaceable>FILENAME</replaceable> if
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000718 given or to the original name.
719 </simpara>
720 </listitem>
721 </varlistentry>
722 <varlistentry>
723 <term><option>validate</option></term>
724 <listitem>
725 <simpara>
726 Check the document for error.
727 </simpara>
728 </listitem>
729 </varlistentry>
730 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000731 <term><command>write <replaceable>FILENAME</replaceable></command></term>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000732 <listitem>
733 <simpara>
734 Write the current node to the given filename.
735 </simpara>
736 </listitem>
737 </varlistentry>
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000738
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000739 </variablelist>
740 </refsect1>
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000741 <refsect1>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000742 <title>ENVIRONMENT</title>
743 <para>On the completion of execution, &xmllint;
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000744 returns the following error codes:</para>
745 <variablelist>
746 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000747 <term><envar>SGML_CATALOG_FILES</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000748 <listitem>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000749 <simpara>...</simpara>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000750 </listitem>
751 </varlistentry>
752 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000753 <term><envar>XML_CATALOG_FILES</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000754 <listitem>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000755 <simpara>Catalog behavior can be changed by redirecting
756 queries to the user's own set of catalogs. This can be done by setting
757 the <envar>XML_CATALOG_FILES</envar> environment variable to a list of
758 catalogs. An empty one should deactivate loading the
759 default <filename>/etc/xml/catalog</filename> default catalog.</simpara>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000760 </listitem>
761 </varlistentry>
762 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000763 <term><envar>XML_DEBUG_CATALOG</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000764 <listitem>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000765 <simpara>Setting the environment variable <envar>XML_DEBUG_CATALOG</envar>
766 using the command <command>&quot;export XML_DEBUG_CATALOG=&quot;</command>
767 outputs debugging information related to catalog operations.</simpara>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000768 </listitem>
769 </varlistentry>
770 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000771 <term><envar>XMLLINT_INDENT</envar></term>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000772 <listitem>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000773 <simpara>...</simpara>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000774 </listitem>
775 </varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000776 </variablelist>
777 </refsect1>
778 <refsect1>
779 <title>DIAGNOSTICS</title>
780 <para>On the completion of execution, &xmllint;
781 returns the following error codes:</para>
782 <variablelist>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000783 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000784 <term><errorcode>0</errorcode></term>
785 <listitem>
786 <simpara>No error</simpara>
787 </listitem>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000788 </varlistentry>
789 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000790 <term><errorcode>1</errorcode></term>
791 <listitem>
792 <simpara>Unclassified</simpara>
793 </listitem>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000794 </varlistentry>
795 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000796 <term><errorcode>2</errorcode></term>
797 <listitem>
798 <simpara>Error in <acronym>DTD</acronym></simpara>
799 </listitem>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000800 </varlistentry>
801 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000802 <term><errorcode>3</errorcode></term>
803 <listitem>
804 <simpara>Validation error</simpara>
805 </listitem>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000806 </varlistentry>
807 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000808 <term><errorcode>4</errorcode></term>
809 <listitem>
810 <simpara>Validation error</simpara>
811 </listitem>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000812 </varlistentry>
813 <varlistentry>
Daniel Veillard6464d6a2006-02-19 21:35:39 +0000814 <term><errorcode>5</errorcode></term>
815 <listitem>
816 <simpara>Error in schema compilation</simpara>
817 </listitem>
818 </varlistentry>
819 <varlistentry>
820 <term><errorcode>6</errorcode></term>
821 <listitem>
822 <simpara>Error writing output</simpara>
823 </listitem>
824 </varlistentry>
825 <varlistentry>
826 <term><errorcode>7</errorcode></term>
827 <listitem>
828 <simpara>Error in pattern (generated when <option>--pattern</option>
829 option is used)</simpara>
830 </listitem>
831 </varlistentry>
832 <varlistentry>
833 <term><errorcode>8</errorcode></term>
834 <listitem>
835 <simpara>Error in Reader registration (generated
836 when <option>--chkregister</option> option is used)</simpara>
837 </listitem>
838 </varlistentry>
839 <varlistentry>
840 <term><errorcode>9</errorcode></term>
841 <listitem>
842 <simpara>Out of memory error</simpara>
843 </listitem>
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000844 </varlistentry>
845 </variablelist>
846 </refsect1>
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000847</refentry>