1 | <?xml version="1.0"?>
|
---|
2 | <?xml-stylesheet type="text/xsl"
|
---|
3 | href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
|
---|
4 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
---|
5 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
---|
6 |
|
---|
7 | <!ENTITY xmllint "<command>xmllint</command>">
|
---|
8 | ]>
|
---|
9 |
|
---|
10 | <refentry>
|
---|
11 |
|
---|
12 | <refentryinfo>
|
---|
13 | <title>xmllint Manual</title>
|
---|
14 | <productname>libxml2</productname>
|
---|
15 | <copyright>
|
---|
16 | <year>2001</year>
|
---|
17 | <year>2004</year>
|
---|
18 | </copyright>
|
---|
19 | <authorgroup>
|
---|
20 | <author>
|
---|
21 | <firstname>John</firstname>
|
---|
22 | <surname>Fleck</surname>
|
---|
23 | <affiliation>
|
---|
24 | <address>
|
---|
25 | <email>[email protected]</email>
|
---|
26 | </address>
|
---|
27 | </affiliation>
|
---|
28 | </author>
|
---|
29 | <author>
|
---|
30 | <firstname>Ziying</firstname>
|
---|
31 | <surname>Sherwin</surname>
|
---|
32 | <affiliation>
|
---|
33 | <address>
|
---|
34 | <email>[email protected]</email>
|
---|
35 | </address>
|
---|
36 | </affiliation>
|
---|
37 | </author>
|
---|
38 | <author>
|
---|
39 | <firstname>Heiko</firstname>
|
---|
40 | <surname>Rupp</surname>
|
---|
41 | <affiliation>
|
---|
42 | <address>
|
---|
43 | <email>[email protected]</email>
|
---|
44 | </address>
|
---|
45 | </affiliation>
|
---|
46 | </author>
|
---|
47 | </authorgroup>
|
---|
48 | <!-- still a bit buggy output, will talk to docbook-xsl upstream to fix this -->
|
---|
49 | <!-- <releaseinfo>This is release 0.5 of the xmllint Manual.</releaseinfo> -->
|
---|
50 | <!-- <edition>0.5</edition> -->
|
---|
51 | </refentryinfo>
|
---|
52 |
|
---|
53 | <refmeta>
|
---|
54 | <refentrytitle>xmllint</refentrytitle>
|
---|
55 | <manvolnum>1</manvolnum>
|
---|
56 | </refmeta>
|
---|
57 |
|
---|
58 | <refnamediv>
|
---|
59 | <refname>xmllint</refname>
|
---|
60 | <refpurpose>command line <acronym>XML</acronym> tool</refpurpose>
|
---|
61 | </refnamediv>
|
---|
62 |
|
---|
63 | <refsynopsisdiv>
|
---|
64 | <cmdsynopsis>
|
---|
65 | <command>xmllint</command>
|
---|
66 | <group choice="opt">
|
---|
67 | <arg choice="plain"><option>--version</option></arg>
|
---|
68 | <arg choice="plain"><option>--debug</option></arg>
|
---|
69 | <arg choice="plain"><option>--shell</option></arg>
|
---|
70 | <arg choice="plain"><option>--xpath "<replaceable class="option">XPath_expression</replaceable>"</option></arg>
|
---|
71 | <arg choice="plain"><option>--debugent</option></arg>
|
---|
72 | <arg choice="plain"><option>--copy</option></arg>
|
---|
73 | <arg choice="plain"><option>--recover</option></arg>
|
---|
74 | <arg choice="plain"><option>--noent</option></arg>
|
---|
75 | <arg choice="plain"><option>--noout</option></arg>
|
---|
76 | <arg choice="plain"><option>--nonet</option></arg>
|
---|
77 | <arg choice="plain"><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></arg>
|
---|
78 | <arg choice="plain"><option>--load-trace</option></arg>
|
---|
79 | <arg choice="plain"><option>--htmlout</option></arg>
|
---|
80 | <arg choice="plain"><option>--nowrap</option></arg>
|
---|
81 | <arg choice="plain"><option>--valid</option></arg>
|
---|
82 | <arg choice="plain"><option>--postvalid</option></arg>
|
---|
83 | <arg choice="plain"><option>--dtdvalid <replaceable class="option">URL</replaceable></option></arg>
|
---|
84 | <arg choice="plain"><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></arg>
|
---|
85 | <arg choice="plain"><option>--timing</option></arg>
|
---|
86 | <arg choice="plain"><option>--output <replaceable class="option">FILE</replaceable></option></arg>
|
---|
87 | <arg choice="plain"><option>--repeat</option></arg>
|
---|
88 | <arg choice="plain"><option>--insert</option></arg>
|
---|
89 | <arg choice="plain"><option>--compress</option></arg>
|
---|
90 | <arg choice="plain"><option>--html</option></arg>
|
---|
91 | <arg choice="plain"><option>--xmlout</option></arg>
|
---|
92 | <arg choice="plain"><option>--push</option></arg>
|
---|
93 | <arg choice="plain"><option>--memory</option></arg>
|
---|
94 | <arg choice="plain"><option>--maxmem <replaceable class="option">NBBYTES</replaceable></option></arg>
|
---|
95 | <arg choice="plain"><option>--nowarning</option></arg>
|
---|
96 | <arg choice="plain"><option>--noblanks</option></arg>
|
---|
97 | <arg choice="plain"><option>--nocdata</option></arg>
|
---|
98 | <arg choice="plain"><option>--format</option></arg>
|
---|
99 | <arg choice="plain"><option>--encode <replaceable class="option">ENCODING</replaceable></option></arg>
|
---|
100 | <arg choice="plain"><option>--dropdtd</option></arg>
|
---|
101 | <arg choice="plain"><option>--nsclean</option></arg>
|
---|
102 | <arg choice="plain"><option>--testIO</option></arg>
|
---|
103 | <arg choice="plain"><option>--catalogs</option></arg>
|
---|
104 | <arg choice="plain"><option>--nocatalogs</option></arg>
|
---|
105 | <arg choice="plain"><option>--auto</option></arg>
|
---|
106 | <arg choice="plain"><option>--xinclude</option></arg>
|
---|
107 | <arg choice="plain"><option>--noxincludenode</option></arg>
|
---|
108 | <arg choice="plain"><option>--loaddtd</option></arg>
|
---|
109 | <arg choice="plain"><option>--dtdattr</option></arg>
|
---|
110 | <arg choice="plain"><option>--stream</option></arg>
|
---|
111 | <arg choice="plain"><option>--walker</option></arg>
|
---|
112 | <arg choice="plain"><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></arg>
|
---|
113 | <arg choice="plain"><option>--chkregister</option></arg>
|
---|
114 | <arg choice="plain"><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></arg>
|
---|
115 | <arg choice="plain"><option>--schema <replaceable class="option">SCHEMA</replaceable></option></arg>
|
---|
116 | <arg choice="plain"><option>--c14n</option></arg>
|
---|
117 | </group>
|
---|
118 | <group choice="req">
|
---|
119 | <arg choice="plain" rep="repeat"><replaceable>XML-FILE(S)</replaceable></arg>
|
---|
120 | <arg choice="plain" rep="norepeat">-</arg>
|
---|
121 | </group>
|
---|
122 | </cmdsynopsis>
|
---|
123 | <cmdsynopsis>
|
---|
124 | <command>xmllint</command>
|
---|
125 | <arg choice="plain"><option>--help</option></arg>
|
---|
126 | </cmdsynopsis>
|
---|
127 | </refsynopsisdiv>
|
---|
128 |
|
---|
129 | <refsect1 id="description">
|
---|
130 | <title>DESCRIPTION</title>
|
---|
131 | <para>
|
---|
132 | The &xmllint; program parses one or more <acronym>XML</acronym> files,
|
---|
133 | specified on the command line as <replaceable>XML-FILE</replaceable>
|
---|
134 | (or the standard input if the filename provided
|
---|
135 | is <emphasis role="bold">-</emphasis> ). It prints various types of
|
---|
136 | output, depending upon the options selected. It is useful for detecting
|
---|
137 | errors both in <acronym>XML</acronym> code and in
|
---|
138 | the <acronym>XML</acronym> parser itself.
|
---|
139 | </para>
|
---|
140 | <para>&xmllint; is included in <citerefentry>
|
---|
141 | <refentrytitle>libxml</refentrytitle>
|
---|
142 | <manvolnum>3</manvolnum>
|
---|
143 | </citerefentry>.</para>
|
---|
144 | </refsect1>
|
---|
145 |
|
---|
146 | <refsect1 id="options">
|
---|
147 | <title>OPTIONS</title>
|
---|
148 | <para>
|
---|
149 | &xmllint; accepts the following options (in alphabetical order):
|
---|
150 | </para>
|
---|
151 |
|
---|
152 | <variablelist>
|
---|
153 |
|
---|
154 | <varlistentry>
|
---|
155 | <term><option>--auto</option></term>
|
---|
156 | <listitem>
|
---|
157 | <para>Generate a small document for testing purposes.</para>
|
---|
158 | </listitem>
|
---|
159 | </varlistentry>
|
---|
160 |
|
---|
161 | <varlistentry>
|
---|
162 | <term><option>--catalogs</option></term>
|
---|
163 | <listitem>
|
---|
164 | <para>
|
---|
165 | Use the <acronym>SGML</acronym> catalog(s) from <envar>SGML_CATALOG_FILES</envar>.
|
---|
166 | Otherwise <acronym>XML</acronym> catalogs starting
|
---|
167 | from <filename>/etc/xml/catalog</filename> are used by default.
|
---|
168 | </para>
|
---|
169 | </listitem>
|
---|
170 | </varlistentry>
|
---|
171 |
|
---|
172 | <varlistentry>
|
---|
173 | <term><option>--chkregister</option></term>
|
---|
174 | <listitem>
|
---|
175 | <para>
|
---|
176 | Turn on node registration. Useful for developers testing <citerefentry>
|
---|
177 | <refentrytitle>libxml</refentrytitle>
|
---|
178 | <manvolnum>3</manvolnum>
|
---|
179 | </citerefentry> node tracking code.
|
---|
180 | </para>
|
---|
181 | </listitem>
|
---|
182 | </varlistentry>
|
---|
183 |
|
---|
184 | <varlistentry>
|
---|
185 | <term><option>--compress</option></term>
|
---|
186 | <listitem>
|
---|
187 | <para>
|
---|
188 | Turn on <citerefentry>
|
---|
189 | <refentrytitle>gzip</refentrytitle>
|
---|
190 | <manvolnum>1</manvolnum>
|
---|
191 | </citerefentry> compression of output.
|
---|
192 | </para>
|
---|
193 | </listitem>
|
---|
194 | </varlistentry>
|
---|
195 |
|
---|
196 | <varlistentry>
|
---|
197 | <term><option>--copy</option></term>
|
---|
198 | <listitem>
|
---|
199 | <para>Test the internal copy implementation.</para>
|
---|
200 | </listitem>
|
---|
201 | </varlistentry>
|
---|
202 |
|
---|
203 | <varlistentry>
|
---|
204 | <term><option>--c14n</option></term>
|
---|
205 | <listitem>
|
---|
206 | <para>
|
---|
207 | Use the W3C <acronym>XML</acronym> Canonicalisation (<acronym>C14N</acronym>) to
|
---|
208 | serialize the result of parsing to <filename class="devicefile">stdout</filename>.
|
---|
209 | It keeps comments in the result.
|
---|
210 | </para>
|
---|
211 | </listitem>
|
---|
212 | </varlistentry>
|
---|
213 |
|
---|
214 | <varlistentry>
|
---|
215 | <term><option>--dtdvalid <replaceable class="option">URL</replaceable></option></term>
|
---|
216 | <listitem>
|
---|
217 | <para>
|
---|
218 | Use the <acronym>DTD</acronym> specified by
|
---|
219 | an <replaceable>URL</replaceable> for validation.
|
---|
220 | </para>
|
---|
221 | </listitem>
|
---|
222 | </varlistentry>
|
---|
223 |
|
---|
224 | <varlistentry>
|
---|
225 | <term><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></term>
|
---|
226 | <listitem>
|
---|
227 | <para>
|
---|
228 | Use the <acronym>DTD</acronym> specified by a Formal Public
|
---|
229 | Identifier <replaceable>FPI</replaceable> for validation, note that this
|
---|
230 | will require a catalog exporting that Formal Public Identifier to work.
|
---|
231 | </para>
|
---|
232 | </listitem>
|
---|
233 | </varlistentry>
|
---|
234 |
|
---|
235 | <varlistentry>
|
---|
236 | <term><option>--debug</option></term>
|
---|
237 | <listitem>
|
---|
238 | <para>
|
---|
239 | Parse a file and output an annotated tree of the
|
---|
240 | in-memory version of the document.
|
---|
241 | </para>
|
---|
242 | </listitem>
|
---|
243 | </varlistentry>
|
---|
244 |
|
---|
245 | <varlistentry>
|
---|
246 | <term><option>--debugent</option></term>
|
---|
247 | <listitem>
|
---|
248 | <para>Debug the entities defined in the document.</para>
|
---|
249 | </listitem>
|
---|
250 | </varlistentry>
|
---|
251 |
|
---|
252 | <varlistentry>
|
---|
253 | <term><option>--dropdtd</option></term>
|
---|
254 | <listitem>
|
---|
255 | <para>Remove <acronym>DTD</acronym> from output.</para>
|
---|
256 | </listitem>
|
---|
257 | </varlistentry>
|
---|
258 |
|
---|
259 | <varlistentry>
|
---|
260 | <term><option>--dtdattr</option></term>
|
---|
261 | <listitem>
|
---|
262 | <para>
|
---|
263 | Fetch external <acronym>DTD</acronym> and populate the tree with
|
---|
264 | inherited attributes.
|
---|
265 | </para>
|
---|
266 | </listitem>
|
---|
267 | </varlistentry>
|
---|
268 |
|
---|
269 | <varlistentry>
|
---|
270 | <term><option>--encode <replaceable class="option">ENCODING</replaceable></option></term>
|
---|
271 | <listitem>
|
---|
272 | <para>Output in the given encoding. Note that this works for full document not fragments or result from XPath queries.</para>
|
---|
273 | </listitem>
|
---|
274 | </varlistentry>
|
---|
275 |
|
---|
276 | <varlistentry>
|
---|
277 | <term><option>--format</option></term>
|
---|
278 | <listitem>
|
---|
279 | <para>
|
---|
280 | Reformat and reindent the output. The <envar>XMLLINT_INDENT</envar>
|
---|
281 | environment variable controls the indentation. The default value is two
|
---|
282 | spaces " ").
|
---|
283 | </para>
|
---|
284 | </listitem>
|
---|
285 | </varlistentry>
|
---|
286 |
|
---|
287 | <varlistentry>
|
---|
288 | <term><option>--help</option></term>
|
---|
289 | <listitem>
|
---|
290 | <para>Print out a short usage summary for &xmllint;.</para>
|
---|
291 | </listitem>
|
---|
292 | </varlistentry>
|
---|
293 |
|
---|
294 | <varlistentry>
|
---|
295 | <term><option>--html</option></term>
|
---|
296 | <listitem>
|
---|
297 | <para>Use the <acronym>HTML</acronym> parser.</para>
|
---|
298 | </listitem>
|
---|
299 | </varlistentry>
|
---|
300 |
|
---|
301 | <varlistentry>
|
---|
302 | <term><option>--htmlout</option></term>
|
---|
303 | <listitem>
|
---|
304 | <para>
|
---|
305 | Output results as an <acronym>HTML</acronym> file. This
|
---|
306 | causes &xmllint; to output the necessary <acronym>HTML</acronym>
|
---|
307 | tags surrounding the result tree output so the results can be
|
---|
308 | displayed/viewed in a browser.
|
---|
309 | </para>
|
---|
310 | </listitem>
|
---|
311 | </varlistentry>
|
---|
312 |
|
---|
313 | <varlistentry>
|
---|
314 | <term><option>--insert</option></term>
|
---|
315 | <listitem>
|
---|
316 | <para>Test for valid insertions.</para>
|
---|
317 | </listitem>
|
---|
318 | </varlistentry>
|
---|
319 |
|
---|
320 | <varlistentry>
|
---|
321 | <term><option>--loaddtd</option></term>
|
---|
322 | <listitem>
|
---|
323 | <para>Fetch an external <acronym>DTD</acronym>.</para>
|
---|
324 | </listitem>
|
---|
325 | </varlistentry>
|
---|
326 |
|
---|
327 | <varlistentry>
|
---|
328 | <term><option>--load-trace</option></term>
|
---|
329 | <listitem>
|
---|
330 | <para>
|
---|
331 | Display all the documents loaded during the processing
|
---|
332 | to <filename class="devicefile">stderr</filename>.
|
---|
333 | </para>
|
---|
334 | </listitem>
|
---|
335 | </varlistentry>
|
---|
336 |
|
---|
337 | <varlistentry>
|
---|
338 | <term><option>--maxmem <replaceable class="option">NNBYTES</replaceable></option></term>
|
---|
339 | <listitem>
|
---|
340 | <para>
|
---|
341 | Test the parser memory support. <replaceable>NNBYTES</replaceable>
|
---|
342 | is the maximum number of bytes the library is allowed to allocate.
|
---|
343 | This can also be used to make sure batch processing
|
---|
344 | of <acronym>XML</acronym> files will not exhaust the virtual memory
|
---|
345 | of the server running them.
|
---|
346 | </para>
|
---|
347 | </listitem>
|
---|
348 | </varlistentry>
|
---|
349 |
|
---|
350 | <varlistentry>
|
---|
351 | <term><option>--memory</option></term>
|
---|
352 | <listitem>
|
---|
353 | <para>Parse from memory.</para>
|
---|
354 | </listitem>
|
---|
355 | </varlistentry>
|
---|
356 |
|
---|
357 | <varlistentry>
|
---|
358 | <term><option>--noblanks</option></term>
|
---|
359 | <listitem>
|
---|
360 | <para>Drop ignorable blank spaces.</para>
|
---|
361 | </listitem>
|
---|
362 | </varlistentry>
|
---|
363 |
|
---|
364 | <varlistentry>
|
---|
365 | <term><option>--nocatalogs</option></term>
|
---|
366 | <listitem>
|
---|
367 | <para>Do not use any catalogs.</para>
|
---|
368 | </listitem>
|
---|
369 | </varlistentry>
|
---|
370 |
|
---|
371 | <varlistentry>
|
---|
372 | <term><option>--nocdata</option></term>
|
---|
373 | <listitem>
|
---|
374 | <para>Substitute CDATA section by equivalent text nodes.</para>
|
---|
375 | </listitem>
|
---|
376 | </varlistentry>
|
---|
377 |
|
---|
378 | <varlistentry>
|
---|
379 | <term><option>--noent</option></term>
|
---|
380 | <listitem>
|
---|
381 | <para>
|
---|
382 | Substitute entity values for entity references. By default, &xmllint;
|
---|
383 | leaves entity references in place.
|
---|
384 | </para>
|
---|
385 | </listitem>
|
---|
386 | </varlistentry>
|
---|
387 |
|
---|
388 | <varlistentry>
|
---|
389 | <term><option>--nonet</option></term>
|
---|
390 | <listitem>
|
---|
391 | <para>
|
---|
392 | Do not use the Internet to fetch <acronym>DTD</acronym>s or entities.
|
---|
393 | </para>
|
---|
394 | </listitem>
|
---|
395 | </varlistentry>
|
---|
396 |
|
---|
397 | <varlistentry>
|
---|
398 | <term><option>--noout</option></term>
|
---|
399 | <listitem>
|
---|
400 | <para>
|
---|
401 | Suppress output. By default, &xmllint; outputs the result tree.
|
---|
402 | </para>
|
---|
403 | </listitem>
|
---|
404 | </varlistentry>
|
---|
405 |
|
---|
406 | <varlistentry>
|
---|
407 | <term><option>--nowarning</option></term>
|
---|
408 | <listitem>
|
---|
409 | <para>Do not emit warnings from the parser and/or validator.</para>
|
---|
410 | </listitem>
|
---|
411 | </varlistentry>
|
---|
412 |
|
---|
413 | <varlistentry>
|
---|
414 | <term><option>--nowrap</option></term>
|
---|
415 | <listitem>
|
---|
416 | <para>Do not output <acronym>HTML</acronym> doc wrapper.</para>
|
---|
417 | </listitem>
|
---|
418 | </varlistentry>
|
---|
419 |
|
---|
420 | <varlistentry>
|
---|
421 | <term><option>--noxincludenode</option></term>
|
---|
422 | <listitem>
|
---|
423 | <para>
|
---|
424 | Do XInclude processing but do not generate XInclude start and end nodes.
|
---|
425 | </para>
|
---|
426 | </listitem>
|
---|
427 | </varlistentry>
|
---|
428 |
|
---|
429 | <varlistentry>
|
---|
430 | <term><option>--nsclean</option></term>
|
---|
431 | <listitem>
|
---|
432 | <para>Remove redundant namespace declarations.</para>
|
---|
433 | </listitem>
|
---|
434 | </varlistentry>
|
---|
435 |
|
---|
436 | <varlistentry>
|
---|
437 | <term><option>--output <replaceable class="option">FILE</replaceable></option></term>
|
---|
438 | <listitem>
|
---|
439 | <para>
|
---|
440 | Define a file path where &xmllint; will save the result of parsing.
|
---|
441 | Usually the programs build a tree and save it
|
---|
442 | on <filename class="devicefile">stdout</filename>, with this option
|
---|
443 | the result <acronym>XML</acronym> instance will be saved onto a file.
|
---|
444 | </para>
|
---|
445 | </listitem>
|
---|
446 | </varlistentry>
|
---|
447 |
|
---|
448 | <varlistentry>
|
---|
449 | <term><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></term>
|
---|
450 | <listitem>
|
---|
451 | <para>
|
---|
452 | Use the (space- or colon-separated) list of filesystem paths specified
|
---|
453 | by <replaceable>PATHS</replaceable> to load <acronym>DTD</acronym>s or
|
---|
454 | entities. Enclose space-separated lists by quotation marks.
|
---|
455 | </para>
|
---|
456 | </listitem>
|
---|
457 | </varlistentry>
|
---|
458 |
|
---|
459 | <varlistentry>
|
---|
460 | <term><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></term>
|
---|
461 | <listitem>
|
---|
462 | <para>
|
---|
463 | Used to exercise the pattern recognition engine, which can be used
|
---|
464 | with the reader interface to the parser. It allows to select some
|
---|
465 | nodes in the document based on an XPath (subset) expression. Used
|
---|
466 | for debugging.
|
---|
467 | </para>
|
---|
468 | </listitem>
|
---|
469 | </varlistentry>
|
---|
470 |
|
---|
471 | <varlistentry>
|
---|
472 | <term><option>--postvalid</option></term>
|
---|
473 | <listitem>
|
---|
474 | <para>Validate after parsing has completed.</para>
|
---|
475 | </listitem>
|
---|
476 | </varlistentry>
|
---|
477 |
|
---|
478 | <varlistentry>
|
---|
479 | <term><option>--push</option></term>
|
---|
480 | <listitem>
|
---|
481 | <para>Use the push mode of the parser.</para>
|
---|
482 | </listitem>
|
---|
483 | </varlistentry>
|
---|
484 |
|
---|
485 | <varlistentry>
|
---|
486 | <term><option>--recover</option></term>
|
---|
487 | <listitem>
|
---|
488 | <para>Output any parsable portions of an invalid document.</para>
|
---|
489 | </listitem>
|
---|
490 | </varlistentry>
|
---|
491 |
|
---|
492 | <varlistentry>
|
---|
493 | <term><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></term>
|
---|
494 | <listitem>
|
---|
495 | <para>
|
---|
496 | Use RelaxNG file named <replaceable class="option">SCHEMA</replaceable>
|
---|
497 | for validation.
|
---|
498 | </para>
|
---|
499 | </listitem>
|
---|
500 | </varlistentry>
|
---|
501 |
|
---|
502 | <varlistentry>
|
---|
503 | <term><option>--repeat</option></term>
|
---|
504 | <listitem>
|
---|
505 | <para>Repeat 100 times, for timing or profiling.</para>
|
---|
506 | </listitem>
|
---|
507 | </varlistentry>
|
---|
508 |
|
---|
509 | <varlistentry>
|
---|
510 | <term><option>--schema <replaceable>SCHEMA</replaceable></option></term>
|
---|
511 | <listitem>
|
---|
512 | <para>
|
---|
513 | Use a W3C <acronym>XML</acronym> Schema file
|
---|
514 | named <replaceable>SCHEMA</replaceable> for validation.
|
---|
515 | </para>
|
---|
516 | </listitem>
|
---|
517 | </varlistentry>
|
---|
518 |
|
---|
519 | <varlistentry>
|
---|
520 | <term><option>--shell</option></term>
|
---|
521 | <listitem>
|
---|
522 | <para>
|
---|
523 | Run a navigating shell. Details on available commands in shell mode
|
---|
524 | are below (see <xref linkend="shell"/>).
|
---|
525 | </para>
|
---|
526 | </listitem>
|
---|
527 | </varlistentry>
|
---|
528 |
|
---|
529 | <varlistentry>
|
---|
530 | <term><option>--xpath "<replaceable class="option">XPath_expression</replaceable>"</option></term>
|
---|
531 | <listitem>
|
---|
532 | <para>
|
---|
533 | Run an XPath expression given as argument and print the
|
---|
534 | result. In case of a nodeset result, each node in the
|
---|
535 | node set is serialized in full in the output. In case
|
---|
536 | of an empty node set the "XPath set is empty" result
|
---|
537 | will be shown and an error exit code will be returned.
|
---|
538 | </para>
|
---|
539 | </listitem>
|
---|
540 | </varlistentry>
|
---|
541 |
|
---|
542 | <varlistentry>
|
---|
543 | <term><option>--stream</option></term>
|
---|
544 | <listitem>
|
---|
545 | <para>
|
---|
546 | Use streaming <acronym>API</acronym> - 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>
|
---|
588 | Display the version of <citerefentry>
|
---|
589 | <refentrytitle>libxml</refentrytitle>
|
---|
590 | <manvolnum>3</manvolnum>
|
---|
591 | </citerefentry> used.
|
---|
592 | </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 an existing in-memory tree. Used for
|
---|
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> from <acronym>HTML</acronym> input.
|
---|
625 | </para>
|
---|
626 | </listitem>
|
---|
627 | </varlistentry>
|
---|
628 |
|
---|
629 | </variablelist>
|
---|
630 | </refsect1>
|
---|
631 |
|
---|
632 | <refsect1 id="shell">
|
---|
633 | <title>SHELL COMMANDS</title>
|
---|
634 | <para>
|
---|
635 | &xmllint; offers an interactive shell mode invoked with
|
---|
636 | the <option>--shell</option> command. Available commands in shell mode
|
---|
637 | include (in alphabetical order):
|
---|
638 | </para>
|
---|
639 | <variablelist>
|
---|
640 |
|
---|
641 | <varlistentry>
|
---|
642 | <term><command>base</command></term>
|
---|
643 | <listitem>
|
---|
644 | <para>Display <acronym>XML</acronym> base of the node.</para>
|
---|
645 | </listitem>
|
---|
646 | </varlistentry>
|
---|
647 |
|
---|
648 | <varlistentry>
|
---|
649 | <term><command>bye</command></term>
|
---|
650 | <listitem>
|
---|
651 | <para>Leave the shell.</para>
|
---|
652 | </listitem>
|
---|
653 | </varlistentry>
|
---|
654 |
|
---|
655 | <varlistentry>
|
---|
656 | <term><command>cat <replaceable>NODE</replaceable></command></term>
|
---|
657 | <listitem>
|
---|
658 | <para>Display the given node or the current one.</para>
|
---|
659 | </listitem>
|
---|
660 | </varlistentry>
|
---|
661 |
|
---|
662 | <varlistentry>
|
---|
663 | <term><command>cd <replaceable>PATH</replaceable></command></term>
|
---|
664 | <listitem>
|
---|
665 | <para>
|
---|
666 | Change the current node to the given path (if unique) or root if no
|
---|
667 | argument is given.
|
---|
668 | </para>
|
---|
669 | </listitem>
|
---|
670 | </varlistentry>
|
---|
671 |
|
---|
672 | <varlistentry>
|
---|
673 | <term><command>dir <replaceable>PATH</replaceable></command></term>
|
---|
674 | <listitem>
|
---|
675 | <para>
|
---|
676 | Dumps information about the node (namespace, attributes, content).
|
---|
677 | </para>
|
---|
678 | </listitem>
|
---|
679 | </varlistentry>
|
---|
680 |
|
---|
681 | <varlistentry>
|
---|
682 | <term><command>du <replaceable>PATH</replaceable></command></term>
|
---|
683 | <listitem>
|
---|
684 | <para>
|
---|
685 | Show the structure of the subtree under the given path or the current node.
|
---|
686 | </para>
|
---|
687 | </listitem>
|
---|
688 | </varlistentry>
|
---|
689 |
|
---|
690 | <varlistentry>
|
---|
691 | <term><command>exit</command></term>
|
---|
692 | <listitem>
|
---|
693 | <para>Leave the shell.</para>
|
---|
694 | </listitem>
|
---|
695 | </varlistentry>
|
---|
696 |
|
---|
697 | <varlistentry>
|
---|
698 | <term><command>help</command></term>
|
---|
699 | <listitem>
|
---|
700 | <para>Show this help.</para>
|
---|
701 | </listitem>
|
---|
702 | </varlistentry>
|
---|
703 |
|
---|
704 | <varlistentry>
|
---|
705 | <term><command>free</command></term>
|
---|
706 | <listitem>
|
---|
707 | <para>Display memory usage.</para>
|
---|
708 | </listitem>
|
---|
709 | </varlistentry>
|
---|
710 |
|
---|
711 | <varlistentry>
|
---|
712 | <term><command>load <replaceable>FILENAME</replaceable></command></term>
|
---|
713 | <listitem>
|
---|
714 | <para>Load a new document with the given filename.</para>
|
---|
715 | </listitem>
|
---|
716 | </varlistentry>
|
---|
717 |
|
---|
718 | <varlistentry>
|
---|
719 | <term><command>ls <replaceable>PATH</replaceable></command></term>
|
---|
720 | <listitem>
|
---|
721 | <para>List contents of the given path or the current directory.</para>
|
---|
722 | </listitem>
|
---|
723 | </varlistentry>
|
---|
724 |
|
---|
725 | <varlistentry>
|
---|
726 | <term><command>pwd</command></term>
|
---|
727 | <listitem>
|
---|
728 | <para>Display the path to the current node.</para>
|
---|
729 | </listitem>
|
---|
730 | </varlistentry>
|
---|
731 |
|
---|
732 | <varlistentry>
|
---|
733 | <term><command>quit</command></term>
|
---|
734 | <listitem>
|
---|
735 | <para>Leave the shell.</para>
|
---|
736 | </listitem>
|
---|
737 | </varlistentry>
|
---|
738 |
|
---|
739 | <varlistentry>
|
---|
740 | <term><command>save <replaceable>FILENAME</replaceable></command></term>
|
---|
741 | <listitem>
|
---|
742 | <para>
|
---|
743 | Save the current document to the given filename or to the original name.
|
---|
744 | </para>
|
---|
745 | </listitem>
|
---|
746 | </varlistentry>
|
---|
747 |
|
---|
748 | <varlistentry>
|
---|
749 | <term><option>validate</option></term>
|
---|
750 | <listitem>
|
---|
751 | <para>Check the document for errors.</para>
|
---|
752 | </listitem>
|
---|
753 | </varlistentry>
|
---|
754 |
|
---|
755 | <varlistentry>
|
---|
756 | <term><command>write <replaceable>FILENAME</replaceable></command></term>
|
---|
757 | <listitem>
|
---|
758 | <para>Write the current node to the given filename.</para>
|
---|
759 | </listitem>
|
---|
760 | </varlistentry>
|
---|
761 |
|
---|
762 | </variablelist>
|
---|
763 | </refsect1>
|
---|
764 |
|
---|
765 | <refsect1 id="environment">
|
---|
766 | <title>ENVIRONMENT</title>
|
---|
767 | <variablelist>
|
---|
768 |
|
---|
769 | <varlistentry>
|
---|
770 | <term><envar>SGML_CATALOG_FILES</envar></term>
|
---|
771 | <listitem>
|
---|
772 | <para><acronym>SGML</acronym> catalog behavior can be changed by redirecting
|
---|
773 | queries to the user's own set of catalogs. This can be done by setting
|
---|
774 | the <envar>SGML_CATALOG_FILES</envar> environment variable to a list
|
---|
775 | of catalogs. An empty one should deactivate loading the
|
---|
776 | default <filename>/etc/sgml/catalog</filename> catalog.
|
---|
777 | </para>
|
---|
778 | </listitem>
|
---|
779 | </varlistentry>
|
---|
780 |
|
---|
781 | <varlistentry>
|
---|
782 | <term><envar>XML_CATALOG_FILES</envar></term>
|
---|
783 | <listitem>
|
---|
784 | <para><acronym>XML</acronym> catalog behavior can be changed by redirecting
|
---|
785 | queries to the user's own set of catalogs. This can be done by setting
|
---|
786 | the <envar>XML_CATALOG_FILES</envar> environment variable to a space-separated
|
---|
787 | list of catalogs. Use percent-encoding to escape spaces or other characters.
|
---|
788 | An empty variable should deactivate loading the default <filename>/etc/xml/catalog</filename> catalog.
|
---|
789 | </para>
|
---|
790 | </listitem>
|
---|
791 | </varlistentry>
|
---|
792 |
|
---|
793 | <varlistentry>
|
---|
794 | <term><envar>XML_DEBUG_CATALOG</envar></term>
|
---|
795 | <listitem>
|
---|
796 | <para>Setting the environment variable <envar>XML_DEBUG_CATALOG</envar>
|
---|
797 | to <parameter>non-zero</parameter> using the <command>export</command>
|
---|
798 | command outputs debugging information related to catalog operations.
|
---|
799 | </para>
|
---|
800 | </listitem>
|
---|
801 | </varlistentry>
|
---|
802 |
|
---|
803 | <varlistentry>
|
---|
804 | <term><envar>XMLLINT_INDENT</envar></term>
|
---|
805 | <listitem>
|
---|
806 | <para>Setting the environment variable <envar>XMLLINT_INDENT</envar>
|
---|
807 | controls the indentation. The default value is two spaces " ".
|
---|
808 | </para>
|
---|
809 | </listitem>
|
---|
810 | </varlistentry>
|
---|
811 |
|
---|
812 | </variablelist>
|
---|
813 | </refsect1>
|
---|
814 |
|
---|
815 | <refsect1 id="diagnostics">
|
---|
816 | <title>DIAGNOSTICS</title>
|
---|
817 | <para>
|
---|
818 | &xmllint; return codes provide information that can be used when
|
---|
819 | calling it from scripts.
|
---|
820 | </para>
|
---|
821 | <!-- better use segmentedlist element later,
|
---|
822 | which is currently only supported in snapshots -->
|
---|
823 | <variablelist>
|
---|
824 |
|
---|
825 | <varlistentry>
|
---|
826 | <term><errorcode>0</errorcode></term>
|
---|
827 | <listitem>
|
---|
828 | <para>No error</para>
|
---|
829 | </listitem>
|
---|
830 | </varlistentry>
|
---|
831 |
|
---|
832 | <varlistentry>
|
---|
833 | <term><errorcode>1</errorcode></term>
|
---|
834 | <listitem>
|
---|
835 | <para>Unclassified</para>
|
---|
836 | </listitem>
|
---|
837 | </varlistentry>
|
---|
838 |
|
---|
839 | <varlistentry>
|
---|
840 | <term><errorcode>2</errorcode></term>
|
---|
841 | <listitem>
|
---|
842 | <para>Error in <acronym>DTD</acronym></para>
|
---|
843 | </listitem>
|
---|
844 | </varlistentry>
|
---|
845 |
|
---|
846 | <varlistentry>
|
---|
847 | <term><errorcode>3</errorcode></term>
|
---|
848 | <listitem>
|
---|
849 | <para>Validation error</para>
|
---|
850 | </listitem>
|
---|
851 | </varlistentry>
|
---|
852 |
|
---|
853 | <varlistentry>
|
---|
854 | <term><errorcode>4</errorcode></term>
|
---|
855 | <listitem>
|
---|
856 | <para>Validation error</para>
|
---|
857 | </listitem>
|
---|
858 | </varlistentry>
|
---|
859 |
|
---|
860 | <varlistentry>
|
---|
861 | <term><errorcode>5</errorcode></term>
|
---|
862 | <listitem>
|
---|
863 | <para>Error in schema compilation</para>
|
---|
864 | </listitem>
|
---|
865 | </varlistentry>
|
---|
866 |
|
---|
867 | <varlistentry>
|
---|
868 | <term><errorcode>6</errorcode></term>
|
---|
869 | <listitem>
|
---|
870 | <para>Error writing output</para>
|
---|
871 | </listitem>
|
---|
872 | </varlistentry>
|
---|
873 |
|
---|
874 | <varlistentry>
|
---|
875 | <term><errorcode>7</errorcode></term>
|
---|
876 | <listitem>
|
---|
877 | <para>
|
---|
878 | Error in pattern (generated when <option>--pattern</option> option is used)
|
---|
879 | </para>
|
---|
880 | </listitem>
|
---|
881 | </varlistentry>
|
---|
882 |
|
---|
883 | <varlistentry>
|
---|
884 | <term><errorcode>8</errorcode></term>
|
---|
885 | <listitem>
|
---|
886 | <para>
|
---|
887 | Error in Reader registration (generated
|
---|
888 | when <option>--chkregister</option> option is used)
|
---|
889 | </para>
|
---|
890 | </listitem>
|
---|
891 | </varlistentry>
|
---|
892 |
|
---|
893 | <varlistentry>
|
---|
894 | <term><errorcode>9</errorcode></term>
|
---|
895 | <listitem>
|
---|
896 | <para>Out of memory error</para>
|
---|
897 | </listitem>
|
---|
898 | </varlistentry>
|
---|
899 |
|
---|
900 | <varlistentry>
|
---|
901 | <term><errorcode>10</errorcode></term>
|
---|
902 | <listitem>
|
---|
903 | <para>XPath evaluation error</para>
|
---|
904 | </listitem>
|
---|
905 | </varlistentry>
|
---|
906 |
|
---|
907 | </variablelist>
|
---|
908 | </refsect1>
|
---|
909 |
|
---|
910 | <refsect1 id="seealso">
|
---|
911 | <title>SEE ALSO</title>
|
---|
912 | <para><citerefentry>
|
---|
913 | <refentrytitle>libxml</refentrytitle>
|
---|
914 | <manvolnum>3</manvolnum>
|
---|
915 | </citerefentry>
|
---|
916 | </para>
|
---|
917 | <para>
|
---|
918 | More information can be found at
|
---|
919 | <itemizedlist>
|
---|
920 | <listitem>
|
---|
921 | <para><citerefentry>
|
---|
922 | <refentrytitle>libxml</refentrytitle>
|
---|
923 | <manvolnum>3</manvolnum>
|
---|
924 | </citerefentry> web page <ulink url="https://gitlab.gnome.org/GNOME/libxml2"/>
|
---|
925 | </para>
|
---|
926 | </listitem>
|
---|
927 | </itemizedlist>
|
---|
928 | </para>
|
---|
929 | </refsect1>
|
---|
930 |
|
---|
931 | </refentry>
|
---|