2002-12-26 02:23:24 +00:00
. \"Generated by db2man.xsl. Don't modify this, modify the source.
2001-10-27 20:14:01 +00:00
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB \\ $1\fR
.PP
. .
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
. .
.de Ip \" List item
.br
.ie \\ n(.$>=3 .ne \\ $3
.el .ne 3
.IP "\\$1" \\ $2
. .
2002-12-26 02:23:24 +00:00
.TH "XMLLINT" 1 "" "" "xmllint Manual"
2001-10-27 20:14:01 +00:00
.SH NAME
xmllint \- command line XML tool
.SH "SYNOPSIS"
2004-02-27 03:26:30 +00:00
.ad l
.hy 0
.HP 8
2006-02-19 21:35:39 +00:00
\fB xmllint\fR [\fB \fB \- \- version\fR \fR | \fB \fB \- \- debug\fR \fR | \fB \fB \- \- shell\fR \fR | \fB \fB \- \- debugent\fR \fR | \fB \fB \- \- copy\fR \fR | \fB \fB \- \- recover\fR \fR | \fB \fB \- \- noent\fR \fR | \fB \fB \- \- noout\fR \fR | \fB \fB \- \- nonet\fR \fR | \fB \fB \- \- path\ "\fI PATHS\fR "\fR \fR | \fB \fB \- \- load\- trace\fR \fR | \fB \fB \- \- htmlout\fR \fR | \fB \fB \- \- nowrap\fR \fR | \fB \fB \- \- valid\fR \fR | \fB \fB \- \- postvalid\fR \fR | \fB \fB \- \- dtdvalid\ \fI URL\fR \fR \fR | \fB \fB \- \- dtdvalidfpi\ \fI FPI\fR \fR \fR | \fB \fB \- \- timing\fR \fR | \fB \fB \- \- output\ \fI FILE\fR \fR \fR | \fB \fB \- \- repeat\fR \fR | \fB \fB \- \- insert\fR \fR | \fB \fB \- \- compress\fR \fR | \fB \fB \- \- html\fR \fR | \fB \fB \- \- xmlout\fR \fR | \fB \fB \- \- push\fR \fR | \fB \fB \- \- memory\fR \fR | \fB \fB \- \- maxmem\ \fI NBBYTES\fR \fR \fR | \fB \fB \- \- nowarning\fR \fR | \fB \fB \- \- noblanks\fR \fR | \fB \fB \- \- nocdata\fR \fR | \fB \fB \- \- format\fR \fR | \fB \fB \- \- encode\ \fI ENCODING\fR \fR \fR | \fB \fB \- \- dropdtd\fR \fR | \fB \fB \- \- nsclean\fR \fR | \fB \fB \- \- testIO\fR \fR | \fB \fB \- \- catalogs\fR \fR | \fB \fB \- \- nocatalogs\fR \fR | \fB \fB \- \- auto\fR \fR | \fB \fB \- \- xinclude\fR \fR | \fB \fB \- \- noxincludenode\fR \fR | \fB \fB \- \- loaddtd\fR \fR | \fB \fB \- \- dtdattr\fR \fR | \fB \fB \- \- stream\fR \fR | \fB \fB \- \- walker\fR \fR | \fB \fB \- \- pattern\ \fI PATTERNVALUE\fR \fR \fR | \fB \fB \- \- chkregister\fR \fR | \fB \fB \- \- relaxng\ \fI SCHEMA\fR \fR \fR | \fB \fB \- \- schema\ \fI SCHEMA\fR \fR \fR | \fB \fB \- \- c14n\fR \fR ] {\fI XML\- FILE(S)\fR ...}
.ad
.hy
.ad l
.hy 0
.HP 8
\fB xmllint\fR \fB \- \- help\fR
2004-02-27 03:26:30 +00:00
.ad
.hy
2002-12-26 02:23:24 +00:00
2006-02-19 21:35:39 +00:00
.SH "DESCRIPTION"
2001-10-27 20:14:01 +00:00
.PP
2006-02-19 21:35:39 +00:00
The \fB xmllint\fR program parses one or more XML files, specified on the command line as \fI XML\- FILE\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\& .
2001-10-27 20:14:01 +00:00
.PP
2004-02-27 03:26:30 +00:00
It is included in libxml2\& .
2001-10-27 20:14:01 +00:00
.SH "OPTIONS"
2006-02-19 21:35:39 +00:00
.TP
\fB \- \- help\fR
Print out a a short usage summary for \fB xmllint\fR \& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- version\fR
Display the version of libxml2 used\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- debug\fR
Parse a file and output an annotated tree of the in\- memory version of the document\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- shell\fR
Run a navigating shell\& . Details on available commands in shell mode are below\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- debugent\fR
Debug the entities defined in the document\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- copy\fR
Test the internal copy implementation\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- recover\fR
Output any parsable portions of an invalid document\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- noent\fR
2006-02-19 21:35:39 +00:00
Substitute entity values for entity references\& . By default, \fB xmllint\fR leaves entity references in place\& .
2001-10-27 20:14:01 +00:00
2003-09-26 13:53:14 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- nocdata\fR
Substitute CDATA section by equivalent text nodes\& .
2003-09-26 13:53:14 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- nsclean\fR
Remove redundant namespace declarations\& .
2003-09-26 13:53:14 +00:00
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- noout\fR
2006-02-19 21:35:39 +00:00
Suppress output\& . By default, \fB xmllint\fR outputs the result tree\& .
2001-10-27 20:14:01 +00:00
2004-08-31 09:37:03 +00:00
.TP
\fB \- \- nonet\fR
2006-02-19 21:35:39 +00:00
Do not use the Internet to fetch DTDs or entities\& .
2004-08-31 09:37:03 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB \- \- path\fR "\fI PATHS\fR "
Use the list (separated by space or colon) of filesystem path specified by \fI PATHS\fR to load DTDs or entities \& .
2004-08-31 09:37:03 +00:00
.TP
\fB \- \- load\- trace\fR
Display to stderr all the documents loaded during the processing\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- htmlout\fR
2006-02-19 21:35:39 +00:00
Output results as an HTML file\& . This causes \fB xmllint\fR to output the necessary HTML tags surrounding the result tree output so the results can be displayed in a browser\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- nowrap \fR
Do not output HTML doc wrapper\& .
2001-10-27 20:14:01 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB \- \- valid\fR
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, \fB xmllint\fR also checks to determine if the document is well\- formed\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- postvalid\fR
Validate after parsing is completed\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- dtdvalid\fR \fI URL\fR
Use the DTD specified by \fI URL\fR for validation\& .
2001-10-27 20:14:01 +00:00
2003-08-18 16:39:51 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- dtdvalidfpi\fR \fI FPI\fR
Use the DTD specified by the Public Identifier \fI FPI\fR for validation, note that this will require a Catalog exporting that Public Identifier to work\& .
2003-08-18 16:39:51 +00:00
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- timing\fR
2006-02-19 21:35:39 +00:00
Output information about the time it takes \fB xmllint\fR to perform the various steps\& .
2001-10-27 20:14:01 +00:00
2004-08-15 00:47:45 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB \- \- output\fR \fI FILE\fR
2004-08-15 00:47:45 +00:00
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\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- repeat\fR
Repeat 100 times, for timing or profiling\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- insert\fR
Test for valid insertions\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- compress\fR
Turn on gzip compression of output\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- html\fR
Use the HTML parser\& .
2001-10-27 20:14:01 +00:00
2004-08-15 00:47:45 +00:00
.TP
\fB \- \- xmlout\fR
2005-07-10 19:03:16 +00:00
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\& .
2004-08-15 00:47:45 +00:00
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- push\fR
Use the push mode of the parser\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- memory\fR
Parse from memory\& .
2001-10-27 20:14:01 +00:00
2004-08-15 00:47:45 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB \- \- maxmem\fR \fI NNBYTES\fR
Test the parser memory support\& . \fI NNBYTES\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\& .
2004-08-15 00:47:45 +00:00
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- nowarning\fR
Do not emit warnings from the parser and/or validator\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- noblanks\fR
Drop ignorable blank spaces\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- format\fR
2006-02-19 21:35:39 +00:00
Reformat and reindent the output\& . The \fB XMLLINT_INDENT\fR environment variable controls the indentation (default value is two spaces " ")\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- testIO\fR
Test user input/output support\& .
2001-10-27 20:14:01 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB \- \- encode\fR \fI ENCODING\fR
2004-02-27 03:26:30 +00:00
Output in the given encoding\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- catalogs\fR
2006-02-19 21:35:39 +00:00
Use the catalogs from \fB SGML_CATALOG_FILES\fR \& . Otherwise \fI /etc/xml/catalog\fR is used by default\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- nocatalogs\fR
Do not use any catalogs\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- auto\fR
Generate a small document for testing purposes\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- xinclude\fR
Do XInclude processing\& .
2001-10-27 20:14:01 +00:00
2004-08-16 12:34:50 +00:00
.TP
\fB \- \- noxincludenode\fR
Do XInclude processing but do not generate XInclude start and end nodes\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- loaddtd\fR
Fetch external DTD\& .
2001-10-27 20:14:01 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- dtdattr\fR
Fetch external DTD and populate the tree with inherited attributes\& .
2001-10-27 20:14:01 +00:00
2001-12-14 04:24:50 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- dropdtd\fR
Remove DTD from output\& .
2001-12-14 04:24:50 +00:00
2003-01-07 03:54:25 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- stream\fR
2006-02-19 21:35:39 +00:00
Use streaming API \- useful when used in combination with \fB \- \- relaxng\fR or \fB \- \- valid\fR options for validation of files that are too large to be held in memory\& .
2003-01-07 03:54:25 +00:00
2004-08-15 00:47:45 +00:00
.TP
\fB \- \- walker\fR
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\& .
2003-01-07 03:54:25 +00:00
.TP
2004-02-27 03:26:30 +00:00
\fB \- \- chkregister\fR
2004-08-14 13:53:13 +00:00
Turn on node registration\& . Useful for developers testing libxml2 node tracking code\& .
2003-01-07 03:54:25 +00:00
2004-08-15 00:47:45 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB \- \- pattern\fR \fI PATTERNVALUE\fR
2004-08-15 00:47:45 +00:00
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\& .
2003-03-25 14:05:17 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB \- \- relaxng\fR \fI SCHEMA\fR
Use RelaxNG file named \fI SCHEMA\fR for validation\& .
2003-03-25 14:05:17 +00:00
2003-05-13 22:14:13 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB \- \- schema\fR \fI SCHEMA\fR
Use a W3C XML Schema file named \fI SCHEMA\fR for validation\& .
2003-05-13 22:14:13 +00:00
2004-08-15 00:54:21 +00:00
.TP
\fB \- \- c14n\fR
2004-08-19 13:45:47 +00:00
Use the W3C XML Canonicalisation (C14N) to serialize the result of parsing to stdout\& . It keeps comments in the result\& .
2003-05-13 22:14:13 +00:00
2006-02-19 21:35:39 +00:00
.SH "SHELL COMMANDS"
2001-11-18 00:18:06 +00:00
.PP
2006-02-19 21:35:39 +00:00
\fB xmllint\fR offers an interactive shell mode invoked with the \fB \- \- shell\fR command\& . Available commands in shell mode include:
2001-11-18 00:18:06 +00:00
.TP
\fB base\fR
display XML base of the node
.TP
\fB bye\fR
leave shell
.TP
2006-02-19 21:35:39 +00:00
\fB cat \fI NODE\fR \fR
2004-02-27 03:26:30 +00:00
Display node if given or current node\& .
2001-11-18 00:18:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB cd \fI PATH\fR \fR
Change the current node to \fI PATH\fR (if given and unique) or root if no argument given\& .
2001-11-18 00:18:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB dir \fI PATH\fR \fR
2004-02-27 03:26:30 +00:00
Dumps information about the node (namespace, attributes, content)\& .
2001-11-18 00:18:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB du \fI PATH\fR \fR
2004-02-27 03:26:30 +00:00
Show the structure of the subtree under path or the current node\& .
2001-11-18 00:18:06 +00:00
.TP
\fB exit\fR
2004-02-27 03:26:30 +00:00
Leave the shell\& .
2001-11-18 00:18:06 +00:00
.TP
\fB help\fR
2004-02-27 03:26:30 +00:00
Show this help\& .
2001-11-18 00:18:06 +00:00
.TP
\fB free\fR
2004-02-27 03:26:30 +00:00
Display memory usage\& .
2001-11-18 00:18:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB load \fI FILENAME\fR \fR
2004-02-27 03:26:30 +00:00
Load a new document with the given name\& .
2001-11-18 00:18:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB ls \fI PATH\fR \fR
List contents of \fI PATH\fR (if given) or the current directory\& .
2001-11-18 00:18:06 +00:00
.TP
\fB pwd\fR
2004-02-27 03:26:30 +00:00
Display the path to the current node\& .
2001-11-18 00:18:06 +00:00
.TP
\fB quit\fR
2004-02-27 03:26:30 +00:00
Leave the shell\& .
2001-11-18 00:18:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB save \fI FILENAME\fR \fR
Saves the current document to \fI FILENAME\fR if given or to the original name\& .
2001-11-18 00:18:06 +00:00
.TP
\fB validate\fR
2004-02-27 03:26:30 +00:00
Check the document for error\& .
2001-11-18 00:18:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB write \fI FILENAME\fR \fR
2004-02-27 03:26:30 +00:00
Write the current node to the given filename\& .
2006-02-19 21:35:39 +00:00
.SH "ENVIRONMENT"
2004-02-27 03:26:30 +00:00
.PP
2006-02-19 21:35:39 +00:00
On the completion of execution, \fB xmllint\fR returns the following error codes:
2001-11-18 00:18:06 +00:00
2006-02-19 21:35:39 +00:00
.TP
\fB SGML_CATALOG_FILES\fR
\& .\& .\& .
2002-12-26 02:23:24 +00:00
2006-02-19 21:35:39 +00:00
.TP
\fB XML_CATALOG_FILES\fR
Catalog behavior can be changed by redirecting queries to the user's own set of catalogs\& . This can be done by setting the \fB XML_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\& .
.TP
\fB XML_DEBUG_CATALOG\fR
Setting the environment variable \fB XML_DEBUG_CATALOG\fR using the command \fB "export XML_DEBUG_CATALOG="\fR outputs debugging information related to catalog operations\& .
.TP
\fB XMLLINT_INDENT\fR
\& .\& .\& .
2002-12-26 02:23:24 +00:00
2006-02-19 21:35:39 +00:00
.SH "DIAGNOSTICS"
2004-06-20 00:36:06 +00:00
.PP
2006-02-19 21:35:39 +00:00
On the completion of execution, \fB xmllint\fR returns the following error codes:
2004-06-20 00:36:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB 0\fR
2004-06-20 00:36:06 +00:00
No error
.TP
2006-02-19 21:35:39 +00:00
\fB 1\fR
2004-06-20 00:36:06 +00:00
Unclassified
.TP
2006-02-19 21:35:39 +00:00
\fB 2\fR
2004-06-20 00:36:06 +00:00
Error in DTD
.TP
2006-02-19 21:35:39 +00:00
\fB 3\fR
2004-06-20 00:36:06 +00:00
Validation error
.TP
2006-02-19 21:35:39 +00:00
\fB 4\fR
2004-06-20 00:36:06 +00:00
Validation error
.TP
2006-02-19 21:35:39 +00:00
\fB 5\fR
2004-06-20 00:36:06 +00:00
Error in schema compilation
.TP
2006-02-19 21:35:39 +00:00
\fB 6\fR
2004-06-20 00:36:06 +00:00
Error writing output
.TP
2006-02-19 21:35:39 +00:00
\fB 7\fR
Error in pattern (generated when \fB \- \- pattern\fR option is used)
2004-06-20 00:36:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB 8\fR
Error in Reader registration (generated when \fB \- \- chkregister\fR option is used)
2004-06-20 00:36:06 +00:00
.TP
2006-02-19 21:35:39 +00:00
\fB 9\fR
2004-06-20 00:36:06 +00:00
Out of memory error
2002-12-26 02:23:24 +00:00
.SH AUTHORS
John Fleck, Ziying Sherwin, Heiko Rupp.