blob: db24d61e3b67e7e05f8ec63021568e69b580e62e [file] [log] [blame]
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +00001.\"Generated by db2man.xsl. Don't modify this, modify the source.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +00002.de Sh \" Subsection
3.br
4.if t .Sp
5.ne 5
6.PP
7\fB\\$1\fR
8.PP
9..
10.de Sp \" Vertical space (when we can't use .PP)
11.if t .sp .5v
12.if n .sp
13..
14.de Ip \" List item
15.br
16.ie \\n(.$>=3 .ne \\$3
17.el .ne 3
18.IP "\\$1" \\$2
19..
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000020.TH "XMLLINT" 1 "" "" "xmllint Manual"
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000021.SH NAME
22xmllint \- command line XML tool
23.SH "SYNOPSIS"
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000024.ad l
25.hy 0
26.HP 8
Daniel Veillard0bff36d2004-08-31 09:37:03 +000027\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-shell\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ \fIpaths\fR\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fIfile\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-maxmem\ \fInbbytes\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fIencoding\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fIpatternvalue\fR\fR | \fB\-\-chkregister\fR | \fB\-\-relaxng\fR | \fB\-\-schema\fR | \fB\-\-c14n\fR] [\fB\fIxmlfile\fR\fR]
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000028.ad
29.hy
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000030
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000031.SH "INTRODUCTION"
32
33.PP
Daniel Veillarde44aafb2004-10-29 12:18:43 +000034The xmllint program parses one or more XML files, specified on the command line as \fIxmlfile\fR (or the standard input if the filename provided is \- )\&. It prints various types of output, depending upon the options selected\&. It is useful for detecting errors both in XML code and in the XML parser itself\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000035
36.PP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000037It is included in libxml2\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000038
39.SH "OPTIONS"
40
41.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000042\fB\-\-version\fR
43Display the version of libxml2 used\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000044
45.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000046\fB\-\-debug\fR
47Parse a file and output an annotated tree of the in\-memory version of the document\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000048
49.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000050\fB\-\-shell\fR
51Run a navigating shell\&. Details on available commands in shell mode are below\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000052
53.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000054\fB\-\-debugent\fR
55Debug the entities defined in the document\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000056
57.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000058\fB\-\-copy\fR
59Test the internal copy implementation\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000060
61.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000062\fB\-\-recover\fR
63Output any parsable portions of an invalid document\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000064
65.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000066\fB\-\-noent\fR
67Substitute entity values for entity references\&. By default, xmllint leaves entity references in place\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000068
69.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000070\fB\-\-nocdata\fR
71Substitute CDATA section by equivalent text nodes\&.
Daniel Veillarddca8cc72003-09-26 13:53:14 +000072
73.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000074\fB\-\-nsclean\fR
75Remove redundant namespace declarations\&.
Daniel Veillarddca8cc72003-09-26 13:53:14 +000076
77.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000078\fB\-\-noout\fR
79Suppress output\&. By default, xmllint outputs the result tree\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000080
81.TP
Daniel Veillard0bff36d2004-08-31 09:37:03 +000082\fB\-\-nonet\fR
83Do not use the Internet to fetch DTD's or entities\&.
84
85.TP
Daniel Veillard0bff36d2004-08-31 09:37:03 +000086\fB\-\-path\fR \fIpaths\fR
87Use the list (separated by space or column) of filesystem path specified by \fIpaths\fR to load DTDs or entities \&.
88
89.TP
90\fB\-\-load\-trace\fR
91Display to stderr all the documents loaded during the processing\&.
92
93.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000094\fB\-\-htmlout\fR
95Output results as an HTML file\&. This causes xmllint to output the necessary HTML tags surrounding the result tree output so the results can be displayed in a browser\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000096
97.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +000098\fB\-\-nowrap \fR
99Do not output HTML doc wrapper\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000100
101.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000102\fB\-\-valid \fR
103Determine if the document is a valid instance of the included Document Type Definition (DTD)\&. A DTD to be validated against also can be specified at the command line using the \fB\-\-dtdvalid\fR option\&. By default, xmllint also checks to determine if the document is well\-formed\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000104
105.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000106\fB\-\-postvalid\fR
107Validate after parsing is completed\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000108
109.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000110\fB\-\-dtdvalid\fR \fIURL\fR
111Use the DTD specified by \fIURL\fR for validation\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000112
113.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000114\fB\-\-dtdvalidfpi\fR \fIFPI\fR
115Use the DTD specified by the Public Identifier \fIFPI\fR for validation, note that this will require a Catalog exporting that Public Identifier to work\&.
Daniel Veillard66f68e72003-08-18 16:39:51 +0000116
117.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000118\fB\-\-timing\fR
119Output information about the time it takes xmllint to perform the various steps\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000120
121.TP
John Fleck3cbaa6d2004-08-15 00:47:45 +0000122\fB\-\-output\fR \fIfile\fR
123Define a file path where xmllint will save the result of parsing\&. Usually the programs build a tree and save it on stdout, with this option the result XML instance will be saved onto a file\&.
124
125.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000126\fB\-\-repeat\fR
127Repeat 100 times, for timing or profiling\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000128
129.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000130\fB\-\-insert\fR
131Test for valid insertions\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000132
133.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000134\fB\-\-compress\fR
135Turn on gzip compression of output\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000136
137.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000138\fB\-\-html\fR
139Use the HTML parser\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000140
141.TP
John Fleck3cbaa6d2004-08-15 00:47:45 +0000142\fB\-\-xmlout\fR
Daniel Veillardf10ae122005-07-10 19:03:16 +0000143Used in conjunction with \fB\-\-html\fR\&. Usually when HTML is parsed the document is saved with the HTML serializer, but with this option the resulting document is saved with the XML serializer\&. This is primarily used to generate XHTML from HTML input\&.
John Fleck3cbaa6d2004-08-15 00:47:45 +0000144
145.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000146\fB\-\-push\fR
147Use the push mode of the parser\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000148
149.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000150\fB\-\-memory\fR
151Parse from memory\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000152
153.TP
John Fleck3cbaa6d2004-08-15 00:47:45 +0000154\fB\-\-maxmem\fR \fInnbytes\fR
155Test the parser memory support\&. \fInnbytes\fR is the maximum number of bytes the library is allowed to allocate\&. This can also be used to make sure batch processing of XML files will not exhaust the virtual memory of the server running them\&.
156
157.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000158\fB\-\-nowarning\fR
159Do not emit warnings from the parser and/or validator\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000160
161.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000162\fB\-\-noblanks\fR
163Drop ignorable blank spaces\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000164
165.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000166\fB\-\-format\fR
167Reformat and reindent the output\&. The $XMLLINT_INDENT environment variable controls the indentation (default value is two spaces " ")\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000168
169.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000170\fB\-\-testIO\fR
171Test user input/output support\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000172
173.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000174\fB\-\-encode\fR \fIencoding\fR
175Output in the given encoding\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000176
177.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000178\fB\-\-catalogs\fR
179Use the catalogs from $SGML_CATALOG_FILES\&. Otherwise /etc/xml/catalog is used by default\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000180
181.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000182\fB\-\-nocatalogs\fR
183Do not use any catalogs\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000184
185.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000186\fB\-\-auto\fR
187Generate a small document for testing purposes\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000188
189.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000190\fB\-\-xinclude\fR
191Do XInclude processing\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000192
193.TP
Daniel Veillardc14c3892004-08-16 12:34:50 +0000194\fB\-\-noxincludenode\fR
195Do XInclude processing but do not generate XInclude start and end nodes\&.
196
197.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000198\fB\-\-loaddtd\fR
199Fetch external DTD\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000200
201.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000202\fB\-\-dtdattr\fR
203Fetch external DTD and populate the tree with inherited attributes\&.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000204
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000205.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000206\fB\-\-dropdtd\fR
207Remove DTD from output\&.
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000208
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000209.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000210\fB\-\-stream\fR
211Use streaming API \- useful when used in combination with \-\-relaxng or \-\-valid options for validation of files that are too large to be held in memory\&.
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000212
213.TP
John Fleck3cbaa6d2004-08-15 00:47:45 +0000214\fB\-\-walker\fR
215Test the walker module, which is a reader interface but for a document tree, instead of using the reader API on an unparsed document it works on a existing in\-memory tree\&. Used in debugging\&.
216
217.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000218\fB\-\-chkregister\fR
Daniel Veillardb9ded822004-08-14 13:53:13 +0000219Turn on node registration\&. Useful for developers testing libxml2 node tracking code\&.
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000220
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000221.TP
John Fleck3cbaa6d2004-08-15 00:47:45 +0000222\fB\-\-pattern\fR \fIpatternvalue\fR
223Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser\&. It allows to select some nodes in the document based on an XPath (subset) expression\&. Used for debugging\&.
224
225.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000226\fB\-\-relaxng\fR \fIschema\fR
227Use RelaxNG file named \fIschema\fR for validation\&.
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000228
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000229.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000230\fB\-\-schema\fR \fIschema\fR
231Use a W3C XML Schema file named \fIschema\fR for validation\&.
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000232
233.TP
MDT 2004 John Fleck774a3bd2004-08-15 00:54:21 +0000234\fB\-\-c14n\fR
MDT 2004 John Fleckb1b3a772004-08-19 13:45:47 +0000235Use the W3C XML Canonicalisation (C14N) to serialize the result of parsing to stdout\&. It keeps comments in the result\&.
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000236
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000237.SH "SHELL"
238
239.PP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000240 xmllint offers an interactive shell mode invoked with the \fB\-\-shell\fR command\&. Available commands in shell mode include:
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000241
242.TP
243\fBbase\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000244display XML base of the node
245
246.TP
247\fBbye\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000248leave shell
249
250.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000251\fBcat \fInode\fR\fR
252Display node if given or current node\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000253
254.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000255\fBcd \fIpath\fR\fR
256Change the current node to \fIpath\fR (if given and unique) or root if no argument given\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000257
258.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000259\fBdir \fIpath\fR\fR
260Dumps information about the node (namespace, attributes, content)\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000261
262.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000263\fBdu \fIpath\fR\fR
264Show the structure of the subtree under path or the current node\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000265
266.TP
267\fBexit\fR
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000268Leave the shell\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000269
270.TP
271\fBhelp\fR
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000272Show this help\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000273
274.TP
275\fBfree\fR
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000276Display memory usage\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000277
278.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000279\fBload \fIname\fR\fR
280Load a new document with the given name\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000281
282.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000283\fBls \fIpath\fR\fR
284List contents of \fIpath\fR (if given) or the current directory\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000285
286.TP
287\fBpwd\fR
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000288Display the path to the current node\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000289
290.TP
291\fBquit\fR
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000292Leave the shell\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000293
294.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000295\fBsave \fIname\fR\fR
296Saves the current document to \fIname\fR if given or to the original name\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000297
298.TP
299\fBvalidate\fR
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000300Check the document for error\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000301
302.TP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000303\fBwrite \fIname\fR\fR
304Write the current node to the given filename\&.
305
306.SH "CATALOGS"
307
308.PP
309Catalog behavior can be changed by redirecting queries to the user's own set of catalogs\&. This can be done by setting the \fIXML_CATALOG_FILES\fR environment variable to a list of catalogs\&. An empty one should deactivate loading the default \fI/etc/xml/catalog\fR default catalog\&.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000310
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000311.SH "DEBUGGING CATALOGS"
312
313.PP
MST 2004 John Flecke42ae6f2004-02-27 03:26:30 +0000314Setting the environment variable \fIXML_DEBUG_CATALOG\fR using the command \fB"export XML_DEBUG_CATALOG="\fR outputs debugging information related to catalog operations\&.
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000315
MDT 2004 John Fleck4c76c4f2004-06-20 00:36:06 +0000316.SH "ERROR RETURN CODES"
317
318.PP
319On the completion of execution, Xmllint returns the following error codes:
320
321.TP
3220
323No error
324
325.TP
3261
327Unclassified
328
329.TP
3302
331Error in DTD
332
333.TP
3343
335Validation error
336
337.TP
3384
339Validation error
340
341.TP
3425
343Error in schema compilation
344
345.TP
3466
347Error writing output
348
349.TP
3507
351Error in pattern (generated when [\-\-pattern] option is used)
352
353.TP
3548
355Error in Reader registration (generated when [\-\-chkregister] option is used)
356
357.TP
3589
359Out of memory error
360
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000361.SH AUTHORS
362John Fleck, Ziying Sherwin, Heiko Rupp.