1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
10 .de Sp \" Vertical space (when we can't use .PP)
16 .ie \\n(.$>=3 .ne \\$3
20 .TH "XMLLINT" 1 "" "" "xmllint Manual"
22 xmllint \- command line XML tool
27 \fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-shell\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ \fIpaths\fR\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fIfile\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-maxmem\ \fInbbytes\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fIencoding\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fIpatternvalue\fR\fR | \fB\-\-chkregister\fR | \fB\-\-relaxng\fR | \fB\-\-schema\fR | \fB\-\-c14n\fR] [\fB\fIxmlfile\fR\fR]
34 The xmllint program parses one or more XML files, specified on the command line as \fIxmlfile\fR (or the standard input if the filename provided is \- )\&. 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\&.
37 It is included in libxml2\&.
43 Display the version of libxml2 used\&.
47 Parse a file and output an annotated tree of the in\-memory version of the document\&.
51 Run a navigating shell\&. Details on available commands in shell mode are below\&.
55 Debug the entities defined in the document\&.
59 Test the internal copy implementation\&.
63 Output any parsable portions of an invalid document\&.
67 Substitute entity values for entity references\&. By default, xmllint leaves entity references in place\&.
71 Substitute CDATA section by equivalent text nodes\&.
75 Remove redundant namespace declarations\&.
79 Suppress output\&. By default, xmllint outputs the result tree\&.
83 Do not use the Internet to fetch DTD's or entities\&.
87 Do not use the Internet to fetch DTD's or entities\&.
90 \fB\-\-path\fR \fIpaths\fR
91 Use the list (separated by space or column) of filesystem path specified by \fIpaths\fR to load DTDs or entities \&.
95 Display to stderr all the documents loaded during the processing\&.
99 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\&.
103 Do not output HTML doc wrapper\&.
107 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\&.
111 Validate after parsing is completed\&.
114 \fB\-\-dtdvalid\fR \fIURL\fR
115 Use the DTD specified by \fIURL\fR for validation\&.
118 \fB\-\-dtdvalidfpi\fR \fIFPI\fR
119 Use the DTD specified by the Public Identifier \fIFPI\fR for validation, note that this will require a Catalog exporting that Public Identifier to work\&.
123 Output information about the time it takes xmllint to perform the various steps\&.
126 \fB\-\-output\fR \fIfile\fR
127 Define a file path where xmllint will save the result of parsing\&. Usually the programs build a tree and save it on stdout, with this option the result XML instance will be saved onto a file\&.
131 Repeat 100 times, for timing or profiling\&.
135 Test for valid insertions\&.
139 Turn on gzip compression of output\&.
143 Use the HTML parser\&.
147 Used in conjunction with \fB\-\-html\fR\&. Usually when HTML is parsed the document is saved with the HTML serializer, but with this option the resulting document is saved with the XML serializer\&. This is primarily used to generate XHTML from HTML input\&.
151 Use the push mode of the parser\&.
158 \fB\-\-maxmem\fR \fInnbytes\fR
159 Test the parser memory support\&. \fInnbytes\fR is the maximum number of bytes the library is allowed to allocate\&. This can also be used to make sure batch processing of XML files will not exhaust the virtual memory of the server running them\&.
163 Do not emit warnings from the parser and/or validator\&.
167 Drop ignorable blank spaces\&.
171 Reformat and reindent the output\&. The $XMLLINT_INDENT environment variable controls the indentation (default value is two spaces " ")\&.
175 Test user input/output support\&.
178 \fB\-\-encode\fR \fIencoding\fR
179 Output in the given encoding\&.
183 Use the catalogs from $SGML_CATALOG_FILES\&. Otherwise /etc/xml/catalog is used by default\&.
187 Do not use any catalogs\&.
191 Generate a small document for testing purposes\&.
195 Do XInclude processing\&.
198 \fB\-\-noxincludenode\fR
199 Do XInclude processing but do not generate XInclude start and end nodes\&.
203 Fetch external DTD\&.
207 Fetch external DTD and populate the tree with inherited attributes\&.
211 Remove DTD from output\&.
215 Use 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\&.
219 Test the walker module, which is a reader interface but for a document tree, instead of using the reader API on an unparsed document it works on a existing in\-memory tree\&. Used in debugging\&.
222 \fB\-\-chkregister\fR
223 Turn on node registration\&. Useful for developers testing libxml2 node tracking code\&.
226 \fB\-\-pattern\fR \fIpatternvalue\fR
227 Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser\&. It allows to select some nodes in the document based on an XPath (subset) expression\&. Used for debugging\&.
230 \fB\-\-relaxng\fR \fIschema\fR
231 Use RelaxNG file named \fIschema\fR for validation\&.
234 \fB\-\-schema\fR \fIschema\fR
235 Use a W3C XML Schema file named \fIschema\fR for validation\&.
239 Use the W3C XML Canonicalisation (C14N) to serialize the result of parsing to stdout\&. It keeps comments in the result\&.
244 xmllint offers an interactive shell mode invoked with the \fB\-\-shell\fR command\&. Available commands in shell mode include:
248 display XML base of the node
256 Display node if given or current node\&.
260 Change the current node to \fIpath\fR (if given and unique) or root if no argument given\&.
264 Dumps information about the node (namespace, attributes, content)\&.
268 Show the structure of the subtree under path or the current node\&.
280 Display memory usage\&.
283 \fBload \fIname\fR\fR
284 Load a new document with the given name\&.
288 List contents of \fIpath\fR (if given) or the current directory\&.
292 Display the path to the current node\&.
299 \fBsave \fIname\fR\fR
300 Saves the current document to \fIname\fR if given or to the original name\&.
304 Check the document for error\&.
307 \fBwrite \fIname\fR\fR
308 Write the current node to the given filename\&.
313 Catalog behavior can be changed by redirecting queries to the user's own set of catalogs\&. This can be done by setting the \fIXML_CATALOG_FILES\fR environment variable to a list of catalogs\&. An empty one should deactivate loading the default \fI/etc/xml/catalog\fR default catalog\&.
315 .SH "DEBUGGING CATALOGS"
318 Setting the environment variable \fIXML_DEBUG_CATALOG\fR using the command \fB"export XML_DEBUG_CATALOG="\fR outputs debugging information related to catalog operations\&.
320 .SH "ERROR RETURN CODES"
323 On the completion of execution, Xmllint returns the following error codes:
347 Error in schema compilation
355 Error in pattern (generated when [\-\-pattern] option is used)
359 Error in Reader registration (generated when [\-\-chkregister] option is used)
366 John Fleck, Ziying Sherwin, Heiko Rupp.