Initial revision
[TestXSLT.git] / libxml2 / doc / xmllint.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .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 ..
20 .TH "XMLLINT" 1 "" "" "xmllint Manual"
21 .SH NAME
22 xmllint \- command line XML tool
23 .SH "SYNOPSIS"
24
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 | \fB--stream\fR
34         | \fB--chkregister\fR] [\fBxmlfile\fR]
35 .fi
36
37 .SH "INTRODUCTION"
38
39 .PP
40 The 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
43 It is included in libxml2.
44
45 .SH "OPTIONS"
46
47 .TP
48 \fB--version\fR
49 Display the version of libxml2 used.
50
51 .TP
52 \fB--debug\fR
53 Parse a file and output an annotated tree of the in-memory version of the document.
54
55 .TP
56 \fB--shell\fR
57 Run a navigating shell. Details on available commands in shell mode are below.
58
59 .TP
60 \fB--debugent\fR
61 Debug the entities defined in the document.
62
63 .TP
64 \fB--copy\fR
65 Test the internal copy implementation.
66
67 .TP
68 \fB--recover\fR
69 Output any parsable portions of an invalid document.
70
71 .TP
72 \fB--noent\fR
73 Substitute entity values for entity references. By default, xmllint leaves entity references in place.
74
75 .TP
76 \fB--noout\fR
77 Suppress output. By default, xmllint outputs the result tree.
78
79 .TP
80 \fB--htmlout\fR
81 Output 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
85 Do not output HTML doc wrapper.
86
87 .TP
88 \fB--valid \fR
89 Determine 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
93 Validate after parsing is completed.
94
95 .TP
96 \fB--dtdvalid\fR \fIURL\fR
97 Use the DTD specified by \fIURL\fR for validation.
98
99 .TP
100 \fB--timing\fR
101 Output information about the time it takes xmllint to perform the various steps.
102
103 .TP
104 \fB--repeat\fR
105 Repeat 100 times, for timing or profiling.
106
107 .TP
108 \fB--insert\fR
109 Test for valid insertions.
110
111 .TP
112 \fB--compress\fR
113 Turn on gzip compression of output.
114
115 .TP
116 \fB--sgml\fR
117 Use 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
120 \fB--html\fR
121 Use the HTML parser.
122
123 .TP
124 \fB--push\fR
125 Use the push mode of the parser.
126
127 .TP
128 \fB--memory\fR
129 Parse from memory.
130
131 .TP
132 \fB--nowarning\fR
133 Do not emit warnings from the parser and/or validator.
134
135 .TP
136 \fB--noblanks\fR
137 Drop ignorable blank spaces.
138
139 .TP
140 \fB--format\fR
141 Reformat and reindent the output.
142
143 .TP
144 \fB--testIO\fR
145 Test user input/output support.
146
147 .TP
148 \fB--encode\fR \fIencoding\fR
149 Output in the given encoding.
150
151 .TP
152 \fB--catalogs\fR
153 Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog is used by default.
154
155 .TP
156 \fB--nocatalogs\fR
157 Do not use any catalogs.
158
159 .TP
160 \fB--auto\fR
161 Generate a small document for testing purposes.
162
163 .TP
164 \fB--xinclude\fR
165 Do XInclude processing.
166
167 .TP
168 \fB--loaddtd\fR
169 Fetch external DTD.
170
171 .TP
172 \fB--dtdattr\fR
173 Fetch external DTD and populate the tree with inherited attributes.
174
175 .TP
176 \fB--dropdtd\fR
177 Remove DTD from output.
178
179 .TP
180 \fB--stream\fR
181 Use streaming API - useful for validation of files that are too large to be held in memory.
182
183 .TP
184 \fB--chkregister\fR
185 Turn on node registration. Useful for developeres testing libxml2 node tracking code.
186
187 .SH "SHELL"
188
189 .PP
190  xmllint offers an interactive shell mode invoked with the \fB--shell\fR command. Available commands in shell mode include:
191
192 .TP
193 \fBbase\fR
194 display XML base of the node
195
196 .TP
197 \fBbye\fR
198 leave shell
199
200 .TP
201 \fBcat node\fR
202 Display node if given or current node.
203
204 .TP
205 \fBcd path\fR
206 Change the current node to \fIpath\fR (if given and unique) or root if no argument given.
207
208 .TP
209 \fBdir path\fR
210 Dumps information about the node (namespace, attributes, content).
211
212 .TP
213 \fBdu path\fR
214 Show the structure of the subtree under path or the current node.
215
216 .TP
217 \fBexit\fR
218 Leave the shell.
219
220 .TP
221 \fBhelp\fR
222 Show this help.
223
224 .TP
225 \fBfree\fR
226 Display memory usage.
227
228 .TP
229 \fBload name\fR
230 Load a new document with the given name.
231
232 .TP
233 \fBls path\fR
234 List contents of \fIpath\fR (if given) or the current directory.
235
236 .TP
237 \fBpwd\fR
238 Display the path to the current node.
239
240 .TP
241 \fBquit\fR
242 Leave the shell.
243
244 .TP
245 \fBsave name\fR
246 Saves the current document to \fIname\fR if given or to the original name.
247
248 .TP
249 \fBvalidate\fR
250 Check the document for error.
251
252 .TP
253 \fBwrite name\fR
254 Write the current node to the given filename.
255
256 .SH "DEBUGGING CATALOGS"
257
258 .PP
259 Setting the environment variable \fIXML_DEBUG_CATALOG\fR using the command \fB"export XML_DEBUG_CATALOG="\fR outputs debugging information related to catalog operations.
260
261 .SH AUTHORS
262 John Fleck, Ziying Sherwin, Heiko Rupp.