blob: 362ef7399ba75f5a9360d6a290f87141c302fc6f [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
29 \fIURL\fR\fR | \fB--timing\fR | \fB--repeat\fR | \fB--insert\fR | \fB--compress\fR
30 | \fB--sgml\fR | \fB--html\fR | \fB--push\fR | \fB--memory\fR | \fB--nowarning\fR
31 | \fB--noblanks\fR | \fB--format\fR | \fB--testIO\fR | \fB--encode \fIencoding\fR\fR
32 | \fB--catalogs\fR | \fB--nocatalogs\fR | \fB--auto\fR | \fB--xinclude\fR
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +000033 | \fB--loaddtd\fR | \fB--dtdattr\fR | \fB--dropdtd\fR | \fB--stream\fR
Daniel Veillarde8b09e42003-05-13 22:14:13 +000034 | \fB--chkregister\fR | \fB--relaxng\fR | \fB--schema\fR | \fB--nonet\fR]
35 [\fBxmlfile\fR]
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000036.fi
37
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000038.SH "INTRODUCTION"
39
40.PP
Daniel Veillardfd583412003-04-25 13:22:10 +000041The 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 +000042
43.PP
Daniel Veillardfd583412003-04-25 13:22:10 +000044It is included in libxml2.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000045
46.SH "OPTIONS"
47
48.TP
49\fB--version\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000050Display the version of libxml2 used.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000051
52.TP
53\fB--debug\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000054Parse a file and output an annotated tree of the in-memory version of the document.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000055
56.TP
57\fB--shell\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000058Run a navigating shell. Details on available commands in shell mode are below.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000059
60.TP
61\fB--debugent\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000062Debug the entities defined in the document.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000063
64.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000065\fB--copy\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000066Test the internal copy implementation.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000067
68.TP
69\fB--recover\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000070Output any parsable portions of an invalid document.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000071
72.TP
73\fB--noent\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000074Substitute entity values for entity references. By default, xmllint leaves entity references in place.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000075
76.TP
77\fB--noout\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000078Suppress output. By default, xmllint outputs the result tree.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000079
80.TP
81\fB--htmlout\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000082Output 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 +000083
84.TP
85\fB--nowrap \fR
Daniel Veillardfd583412003-04-25 13:22:10 +000086Do not output HTML doc wrapper.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000087
88.TP
89\fB--valid \fR
Daniel Veillardfd583412003-04-25 13:22:10 +000090Determine 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 +000091
92.TP
93\fB--postvalid\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000094Validate after parsing is completed.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000095
96.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000097\fB--dtdvalid\fR \fIURL\fR
Daniel Veillardfd583412003-04-25 13:22:10 +000098Use the DTD specified by \fIURL\fR for validation.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000099
100.TP
101\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
John Fleck027edfb2001-11-04 20:13:58 +0000117\fB--sgml\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000118Use the DocBook SGML parser. This allows documents written in SGML DocBook to be converted into an in-memory tree and treated as if they were written in XML.
John Fleck027edfb2001-11-04 20:13:58 +0000119
120.TP
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000121\fB--html\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000122Use the HTML parser.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000123
124.TP
125\fB--push\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000126Use the push mode of the parser.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000127
128.TP
129\fB--memory\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000130Parse from memory.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000131
132.TP
133\fB--nowarning\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000134Do not emit warnings from the parser and/or validator.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000135
136.TP
137\fB--noblanks\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000138Drop ignorable blank spaces.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000139
140.TP
141\fB--format\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000142Reformat 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 +0000143
144.TP
145\fB--testIO\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000146Test user input/output support.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000147
148.TP
149\fB--encode\fR \fIencoding\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000150Output in the given encoding.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000151
152.TP
153\fB--catalogs\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000154Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog is used by default.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000155
156.TP
157\fB--nocatalogs\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000158Do not use any catalogs.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000159
160.TP
161\fB--auto\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000162Generate a small document for testing purposes.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000163
164.TP
165\fB--xinclude\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000166Do XInclude processing.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000167
168.TP
169\fB--loaddtd\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000170Fetch external DTD.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000171
172.TP
173\fB--dtdattr\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000174Fetch external DTD and populate the tree with inherited attributes.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000175
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000176.TP
177\fB--dropdtd\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000178Remove DTD from output.
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000179
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000180.TP
181\fB--stream\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000182Use 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 +0000183
184.TP
185\fB--chkregister\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000186Turn on node registration. Useful for developeres testing libxml2 node tracking code.
MST 2003 John Fleck7e54be12003-01-07 03:54:25 +0000187
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000188.TP
189\fB--relaxng\fR \fIschema\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000190Use RelaxNG file named \fIschema\fR for validation.
MST 2003 John Fleckda271742003-03-25 14:05:17 +0000191
Daniel Veillarde8b09e42003-05-13 22:14:13 +0000192.TP
193\fB--schema\fR \fIschema\fR
194Use a W3C XML Schema file named \fIschema\fR for validation.
195
196.TP
197\fB--nonet\fR
198Do not use the Internet to fetch DTD's or entities.
199
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000200.SH "SHELL"
201
202.PP
Daniel Veillardfd583412003-04-25 13:22:10 +0000203 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 +0000204
205.TP
206\fBbase\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000207display XML base of the node
208
209.TP
210\fBbye\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000211leave shell
212
213.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000214\fBcat node\fR
215Display node if given or current node.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000216
217.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000218\fBcd path\fR
219Change 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 +0000220
221.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000222\fBdir path\fR
223Dumps information about the node (namespace, attributes, content).
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000224
225.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000226\fBdu path\fR
227Show the structure of the subtree under path or the current node.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000228
229.TP
230\fBexit\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000231Leave the shell.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000232
233.TP
234\fBhelp\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000235Show this help.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000236
237.TP
238\fBfree\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000239Display memory usage.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000240
241.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000242\fBload name\fR
243Load a new document with the given name.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000244
245.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000246\fBls path\fR
247List contents of \fIpath\fR (if given) or the current directory.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000248
249.TP
250\fBpwd\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000251Display the path to the current node.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000252
253.TP
254\fBquit\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000255Leave the shell.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000256
257.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000258\fBsave name\fR
259Saves the current document to \fIname\fR if given or to the original name.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000260
261.TP
262\fBvalidate\fR
Daniel Veillardfd583412003-04-25 13:22:10 +0000263Check the document for error.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000264
265.TP
Daniel Veillardfd583412003-04-25 13:22:10 +0000266\fBwrite name\fR
267Write the current node to the given filename.
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000268
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000269.SH "DEBUGGING CATALOGS"
270
271.PP
Daniel Veillardfd583412003-04-25 13:22:10 +0000272Setting 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 +0000273
274.SH AUTHORS
275John Fleck, Ziying Sherwin, Heiko Rupp.