blob: 9e1640ae4aa9fa451f3a7e9d97561ea1facc8dd1 [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 2002 John Fleck6647aed2002-12-26 02:23:24 +000024
25.nf
26\fBxmllint\fR [\fB--version\fR | \fB--debug\fR | \fB--shell\fR | \fB--debugent\fR |
Daniel Veillarddca8cc72003-09-26 13:53:14 +000027 \fB--copy\fR | \fB--recover\fR | \fB--noent\fR | \fB--nocdata\fR | \fB--nsclean\fR
28 | \fB--noout\fR | \fB--htmlout\fR | \fB--nowrap\fR | \fB--valid\fR |
29 \fB--postvalid\fR | \fB--dtdvalid \fIURL\fR\fR | \fB--dtdvalidfpi \fIFPI\fR\fR
30 | \fB--timing\fR | \fB--repeat\fR | \fB--insert\fR | \fB--compress\fR
31 | \fB--html\fR | \fB--push\fR | \fB--memory\fR | \fB--nowarning\fR |
32 \fB--noblanks\fR | \fB--format\fR | \fB--testIO\fR | \fB--encode \fIencoding\fR\fR
33 | \fB--catalogs\fR | \fB--nocatalogs\fR | \fB--auto\fR | \fB--xinclude\fR
34 | \fB--loaddtd\fR | \fB--dtdattr\fR | \fB--dropdtd\fR | \fB--stream\fR
35 | \fB--chkregister\fR | \fB--relaxng\fR | \fB--schema\fR | \fB--nonet\fR]
36 [\fBxmlfile\fR]
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000037.fi
38
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000039.SH "INTRODUCTION"
40
41.PP
Daniel Veillardfd583412003-04-25 13:22:10 +000042The xmllint program parses one or more XML files, specified on the command line as \fIxmlfile\fR. 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 +000043
44.PP
Daniel Veillardfd583412003-04-25 13:22:10 +000045It is included in libxml2.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000046
47.SH "OPTIONS"
48
49.TP
50\fB--version\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000051Display the version of libxml2 used.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000052
53.TP
54\fB--debug\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000055Parse a file and output an annotated tree of the in-memory version of the document.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000056
57.TP
58\fB--shell\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000059Run a navigating shell. Details on available commands in shell mode are below.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000060
61.TP
62\fB--debugent\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000063Debug the entities defined in the document.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000064
65.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000066\fB--copy\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000067Test the internal copy implementation.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000068
69.TP
70\fB--recover\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000071Output any parsable portions of an invalid document.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000072
73.TP
74\fB--noent\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000075Substitute entity values for entity references. By default, xmllint leaves entity references in place.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000076
77.TP
Daniel Veillarddca8cc72003-09-26 13:53:14 +000078\fB--nocdata\fR
79Substitute CDATA section by equivalent text nodes.
80
81.TP
82\fB--nsclean\fR
83Remove redundant namespace declarations.
84
85.TP
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000086\fB--noout\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000087Suppress output. By default, xmllint outputs the result tree.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000088
89.TP
90\fB--htmlout\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000091Output 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 +000092
93.TP
94\fB--nowrap \fR
Daniel Veillardfd583412003-04-25 13:22:10 +000095Do not output HTML doc wrapper.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000096
97.TP
98\fB--valid \fR
Daniel Veillardfd583412003-04-25 13:22:10 +000099Determine 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 +0000100
101.TP
102\fB--postvalid\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000103Validate after parsing is completed.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000104
105.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000106\fB--dtdvalid\fR \fIURL\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000107Use the DTD specified by \fIURL\fR for validation.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000108
109.TP
Daniel Veillard66f68e72003-08-18 16:39:51 +0000110\fB--dtdvalidfpi\fR \fIFPI\fR
111Use the DTD specified by the Public Identifier \fIFPI\fR for validation, note that this will require a Catalog exporting that Public Identifier to work.
112
113.TP
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000114\fB--timing\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000115Output information about the time it takes xmllint to perform the various steps.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000116
117.TP
118\fB--repeat\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000119Repeat 100 times, for timing or profiling.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000120
121.TP
122\fB--insert\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000123Test for valid insertions.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000124
125.TP
126\fB--compress\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000127Turn on gzip compression of output.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000128
129.TP
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000130\fB--html\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000131Use the HTML parser.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000132
133.TP
134\fB--push\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000135Use the push mode of the parser.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000136
137.TP
138\fB--memory\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000139Parse from memory.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000140
141.TP
142\fB--nowarning\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000143Do not emit warnings from the parser and/or validator.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000144
145.TP
146\fB--noblanks\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000147Drop ignorable blank spaces.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000148
149.TP
150\fB--format\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000151Reformat 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 +0000152
153.TP
154\fB--testIO\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000155Test user input/output support.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000156
157.TP
158\fB--encode\fR \fIencoding\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000159Output in the given encoding.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000160
161.TP
162\fB--catalogs\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000163Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog is used by default.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000164
165.TP
166\fB--nocatalogs\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000167Do not use any catalogs.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000168
169.TP
170\fB--auto\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000171Generate a small document for testing purposes.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000172
173.TP
174\fB--xinclude\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000175Do XInclude processing.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000176
177.TP
178\fB--loaddtd\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000179Fetch external DTD.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000180
181.TP
182\fB--dtdattr\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000183Fetch external DTD and populate the tree with inherited attributes.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000184
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000185.TP
186\fB--dropdtd\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000187Remove DTD from output.
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000188
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000189.TP
190\fB--stream\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000191Use 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 +0000192
193.TP
194\fB--chkregister\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000195Turn on node registration. Useful for developeres testing libxml2 node tracking code.
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000196
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000197.TP
198\fB--relaxng\fR \fIschema\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000199Use RelaxNG file named \fIschema\fR for validation.
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000200
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000201.TP
202\fB--schema\fR \fIschema\fR
203Use a W3C XML Schema file named \fIschema\fR for validation.
204
205.TP
206\fB--nonet\fR
207Do not use the Internet to fetch DTD's or entities.
208
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000209.SH "SHELL"
210
211.PP
Daniel Veillardfd583412003-04-25 13:22:10 +0000212 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 +0000213
214.TP
215\fBbase\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000216display XML base of the node
217
218.TP
219\fBbye\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000220leave shell
221
222.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000223\fBcat node\fR
224Display node if given or current node.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000225
226.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000227\fBcd path\fR
228Change 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 +0000229
230.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000231\fBdir path\fR
232Dumps information about the node (namespace, attributes, content).
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000233
234.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000235\fBdu path\fR
236Show the structure of the subtree under path or the current node.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000237
238.TP
239\fBexit\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000240Leave the shell.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000241
242.TP
243\fBhelp\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000244Show this help.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000245
246.TP
247\fBfree\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000248Display memory usage.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000249
250.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000251\fBload name\fR
252Load a new document with the given name.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000253
254.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000255\fBls path\fR
256List contents of \fIpath\fR (if given) or the current directory.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000257
258.TP
259\fBpwd\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000260Display the path to the current node.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000261
262.TP
263\fBquit\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000264Leave the shell.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000265
266.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000267\fBsave name\fR
268Saves the current document to \fIname\fR if given or to the original name.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000269
270.TP
271\fBvalidate\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000272Check the document for error.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000273
274.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000275\fBwrite name\fR
276Write the current node to the given filename.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000277
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000278.SH "DEBUGGING CATALOGS"
279
280.PP
Daniel Veillardfd583412003-04-25 13:22:10 +0000281Setting 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 +0000282
283.SH AUTHORS
284John Fleck, Ziying Sherwin, Heiko Rupp.