blob: c90a8934a87fee844b915e883be20ac20caa9d82 [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
33 | \fB--loaddtd\fR | \fB--dtdattr\fR | \fB--dropdtd\fR] [\fBxmlfile\fR]
34
35.fi
36
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000037.SH "INTRODUCTION"
38
39.PP
40The 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.
41
42.PP
43It is included in libxml2.
44
45.SH "OPTIONS"
46
47.TP
48\fB--version\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000049Display the version of libxml2 used.
50
51.TP
52\fB--debug\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000053Parse a file and output an annotated tree of the in-memory version of the document.
54
55.TP
56\fB--shell\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +000057Run a navigating shell. Details on available commands in shell mode are below.
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000058
59.TP
60\fB--debugent\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000061Debug the entities defined in the document.
62
63.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000064\fB--copy\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000065Test the internal copy implementation.
66
67.TP
68\fB--recover\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000069Output any parsable portions of an invalid document.
70
71.TP
72\fB--noent\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000073Substitute entity values for entity references. By default, xmllint leaves entity references in place.
74
75.TP
76\fB--noout\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000077Suppress output. By default, xmllint outputs the result tree.
78
79.TP
80\fB--htmlout\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000081Output 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.
82
83.TP
84\fB--nowrap \fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000085Do not output HTML doc wrapper.
86
87.TP
88\fB--valid \fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000089Determine 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.
90
91.TP
92\fB--postvalid\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000093Validate after parsing is completed.
94
95.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +000096\fB--dtdvalid\fR \fIURL\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +000097Use the DTD specified by \fIURL\fR for validation.
98
99.TP
100\fB--timing\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000101Output information about the time it takes xmllint to perform the various steps.
102
103.TP
104\fB--repeat\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000105Repeat 100 times, for timing or profiling.
106
107.TP
108\fB--insert\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000109Test for valid insertions.
110
111.TP
112\fB--compress\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000113Turn on gzip compression of output.
114
115.TP
John Fleck027edfb2001-11-04 20:13:58 +0000116\fB--sgml\fR
John Fleck027edfb2001-11-04 20:13:58 +0000117Use 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.
118
119.TP
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000120\fB--html\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000121Use the HTML parser.
122
123.TP
124\fB--push\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000125Use the push mode of the parser.
126
127.TP
128\fB--memory\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000129Parse from memory.
130
131.TP
132\fB--nowarning\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000133Do not emit warnings from the parser and/or validator.
134
135.TP
136\fB--noblanks\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000137Drop ignorable blank spaces.
138
139.TP
140\fB--format\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000141Reformat and reindent the output.
142
143.TP
144\fB--testIO\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000145Test user input/output support.
146
147.TP
148\fB--encode\fR \fIencoding\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000149Output in the given encoding.
150
151.TP
152\fB--catalogs\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000153Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog is used by default.
154
155.TP
156\fB--nocatalogs\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000157Do not use any catalogs.
158
159.TP
160\fB--auto\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000161Generate a small document for testing purposes.
162
163.TP
164\fB--xinclude\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000165Do XInclude processing.
166
167.TP
168\fB--loaddtd\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000169Fetch external DTD.
170
171.TP
172\fB--dtdattr\fR
MDT 2001 John Fleckfd32de62001-10-27 20:14:01 +0000173Fetch external DTD and populate the tree with inherited attributes.
174
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000175.TP
176\fB--dropdtd\fR
MST 2001 John Fleck2323ac22001-12-14 04:24:50 +0000177Remove DTD from output.
178
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000179.SH "SHELL"
180
181.PP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000182 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 +0000183
184.TP
185\fBbase\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000186display XML base of the node
187
188.TP
189\fBbye\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000190leave shell
191
192.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000193\fBcat node\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000194Display node if given or current node.
195
196.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000197\fBcd path\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000198Change the current node to \fIpath\fR (if given and unique) or root if no argument given.
199
200.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000201\fBdir path\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000202Dumps information about the node (namespace, attributes, content).
203
204.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000205\fBdu path\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000206Show the structure of the subtree under path or the current node.
207
208.TP
209\fBexit\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000210Leave the shell.
211
212.TP
213\fBhelp\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000214Show this help.
215
216.TP
217\fBfree\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000218Display memory usage.
219
220.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000221\fBload name\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000222Load a new document with the given name.
223
224.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000225\fBls path\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000226List contents of \fIpath\fR (if given) or the current directory.
227
228.TP
229\fBpwd\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000230Display the path to the current node.
231
232.TP
233\fBquit\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000234Leave the shell.
235
236.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000237\fBsave name\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000238Saves the current document to \fIname\fR if given or to the original name.
239
240.TP
241\fBvalidate\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000242Check the document for error.
243
244.TP
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000245\fBwrite name\fR
MST 2001 John Fleck42304042001-11-18 00:18:06 +0000246Write the current node to the given filename.
247
MST 2002 John Fleck6647aed2002-12-26 02:23:24 +0000248.SH "DEBUGGING CATALOGS"
249
250.PP
251Setting the environment variable \fIXML_DEBUG_CATALOG\fR using the command \fB"export XML_DEBUG_CATALOG="\fR outputs debugging information related to catalog operations.
252
253.SH AUTHORS
254John Fleck, Ziying Sherwin, Heiko Rupp.