blob: cf1bd8ba73bbeeda52dcbab4276e4dbdd360bf5f [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 |
27 \fB--copy\fR | \fB--recover\fR | \fB--noent\fR | \fB--noout\fR | \fB--htmlout\fR
28 | \fB--nowrap\fR | \fB--valid\fR | \fB--postvalid\fR | \fB--dtdvalid
Daniel Veillard66f68e72003-08-18 16:39:51 +000029 \fIURL\fR\fR | \fB--dtdvalidfpi \fIFPI\fR\fR | \fB--timing\fR | \fB--repeat\fR
Daniel Veillard877a7bd2003-09-13 00:16:32 +000030 | \fB--insert\fR | \fB--compress\fR | \fB--html\fR | \fB--push\fR | \fB--memory\fR | \fB--nowarning\fR | \fB--noblanks\fR | \fB--format\fR | \fB--testIO\fR | \fB--encode \fIencoding\fR\fR | \fB--catalogs\fR | \fB--nocatalogs\fR | \fB--auto\fR | \fB--xinclude\fR | \fB--loaddtd\fR | \fB--dtdattr\fR | \fB--dropdtd\fR | \fB--stream\fR | \fB--chkregister\fR | \fB--relaxng\fR | \fB--schema\fR | \fB--nonet\fR] [\fBxmlfile\fR]
Daniel Veillard66f68e72003-08-18 16:39:51 +000031
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000032.fi
33
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000034.SH "INTRODUCTION"
35
36.PP
Daniel Veillardfd583412003-04-25 13:22:10 +000037The 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 +000038
39.PP
Daniel Veillardfd583412003-04-25 13:22:10 +000040It is included in libxml2.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000041
42.SH "OPTIONS"
43
44.TP
45\fB--version\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000046Display the version of libxml2 used.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000047
48.TP
49\fB--debug\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000050Parse a file and output an annotated tree of the in-memory version of the document.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000051
52.TP
53\fB--shell\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000054Run a navigating shell. Details on available commands in shell mode are below.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000055
56.TP
57\fB--debugent\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000058Debug the entities defined in the document.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000059
60.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000061\fB--copy\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000062Test the internal copy implementation.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000063
64.TP
65\fB--recover\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000066Output any parsable portions of an invalid document.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000067
68.TP
69\fB--noent\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000070Substitute entity values for entity references. By default, xmllint leaves entity references in place.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000071
72.TP
73\fB--noout\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000074Suppress output. By default, xmllint outputs the result tree.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000075
76.TP
77\fB--htmlout\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000078Output 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 +000079
80.TP
81\fB--nowrap \fR
Daniel Veillardfd583412003-04-25 13:22:10 +000082Do not output HTML doc wrapper.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000083
84.TP
85\fB--valid \fR
Daniel Veillardfd583412003-04-25 13:22:10 +000086Determine 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 +000087
88.TP
89\fB--postvalid\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000090Validate after parsing is completed.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000091
92.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000093\fB--dtdvalid\fR \fIURL\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000094Use the DTD specified by \fIURL\fR for validation.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000095
96.TP
Daniel Veillard66f68e72003-08-18 16:39:51 +000097\fB--dtdvalidfpi\fR \fIFPI\fR
98Use the DTD specified by the Public Identifier \fIFPI\fR for validation, note that this will require a Catalog exporting that Public Identifier to work.
99
100.TP
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000101\fB--timing\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000102Output information about the time it takes xmllint to perform the various steps.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000103
104.TP
105\fB--repeat\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000106Repeat 100 times, for timing or profiling.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000107
108.TP
109\fB--insert\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000110Test for valid insertions.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000111
112.TP
113\fB--compress\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000114Turn on gzip compression of output.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000115
116.TP
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000117\fB--html\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000118Use the HTML parser.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000119
120.TP
121\fB--push\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000122Use the push mode of the parser.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000123
124.TP
125\fB--memory\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000126Parse from memory.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000127
128.TP
129\fB--nowarning\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000130Do not emit warnings from the parser and/or validator.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000131
132.TP
133\fB--noblanks\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000134Drop ignorable blank spaces.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000135
136.TP
137\fB--format\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000138Reformat 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 +0000139
140.TP
141\fB--testIO\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000142Test user input/output support.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000143
144.TP
145\fB--encode\fR \fIencoding\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000146Output in the given encoding.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000147
148.TP
149\fB--catalogs\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000150Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog is used by default.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000151
152.TP
153\fB--nocatalogs\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000154Do not use any catalogs.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000155
156.TP
157\fB--auto\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000158Generate a small document for testing purposes.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000159
160.TP
161\fB--xinclude\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000162Do XInclude processing.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000163
164.TP
165\fB--loaddtd\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000166Fetch external DTD.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000167
168.TP
169\fB--dtdattr\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000170Fetch external DTD and populate the tree with inherited attributes.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000171
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000172.TP
173\fB--dropdtd\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000174Remove DTD from output.
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000175
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000176.TP
177\fB--stream\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000178Use 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 +0000179
180.TP
181\fB--chkregister\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000182Turn on node registration. Useful for developeres testing libxml2 node tracking code.
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000183
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000184.TP
185\fB--relaxng\fR \fIschema\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000186Use RelaxNG file named \fIschema\fR for validation.
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000187
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000188.TP
189\fB--schema\fR \fIschema\fR
190Use a W3C XML Schema file named \fIschema\fR for validation.
191
192.TP
193\fB--nonet\fR
194Do not use the Internet to fetch DTD's or entities.
195
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000196.SH "SHELL"
197
198.PP
Daniel Veillardfd583412003-04-25 13:22:10 +0000199 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 +0000200
201.TP
202\fBbase\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000203display XML base of the node
204
205.TP
206\fBbye\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000207leave shell
208
209.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000210\fBcat node\fR
211Display node if given or current node.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000212
213.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000214\fBcd path\fR
215Change 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 +0000216
217.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000218\fBdir path\fR
219Dumps information about the node (namespace, attributes, content).
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000220
221.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000222\fBdu path\fR
223Show the structure of the subtree under path or the current node.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000224
225.TP
226\fBexit\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000227Leave the shell.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000228
229.TP
230\fBhelp\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000231Show this help.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000232
233.TP
234\fBfree\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000235Display memory usage.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000236
237.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000238\fBload name\fR
239Load a new document with the given name.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000240
241.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000242\fBls path\fR
243List contents of \fIpath\fR (if given) or the current directory.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000244
245.TP
246\fBpwd\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000247Display the path to the current node.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000248
249.TP
250\fBquit\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000251Leave the shell.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000252
253.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000254\fBsave name\fR
255Saves the current document to \fIname\fR if given or to the original name.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000256
257.TP
258\fBvalidate\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000259Check the document for error.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000260
261.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000262\fBwrite name\fR
263Write the current node to the given filename.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000264
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000265.SH "DEBUGGING CATALOGS"
266
267.PP
Daniel Veillardfd583412003-04-25 13:22:10 +0000268Setting 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 +0000269
270.SH AUTHORS
271John Fleck, Ziying Sherwin, Heiko Rupp.