2002-12-26 05:23:24 +03:00
. \"Generated by db2man.xsl. Don't modify this, modify the source.
2001-10-28 00:14:01 +04: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 05:23:24 +03:00
.TH "XMLLINT" 1 "" "" "xmllint Manual"
2001-10-28 00:14:01 +04:00
.SH NAME
xmllint \- command line XML tool
.SH "SYNOPSIS"
2002-12-26 05:23:24 +03:00
.nf
\fB xmllint\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 --htmlout\fR
| \fB --nowrap\fR | \fB --valid\fR | \fB --postvalid\fR | \fB --dtdvalid
\fI URL\fR \fR | \fB --timing\fR | \fB --repeat\fR | \fB --insert\fR | \fB --compress\fR
| \fB --sgml\fR | \fB --html\fR | \fB --push\fR | \fB --memory\fR | \fB --nowarning\fR
| \fB --noblanks\fR | \fB --format\fR | \fB --testIO\fR | \fB --encode \fI encoding\fR \fR
| \fB --catalogs\fR | \fB --nocatalogs\fR | \fB --auto\fR | \fB --xinclude\fR
2003-01-07 06:54:25 +03:00
| \fB --loaddtd\fR | \fB --dtdattr\fR | \fB --dropdtd\fR | \fB --stream\fR
2003-03-10 04:03:53 +03:00
| \fB --chkregister\fR ] [\fB \fI xmlfile\fR \fR ]
2002-12-26 05:23:24 +03:00
.fi
2001-10-28 00:14:01 +04:00
.SH "INTRODUCTION"
.PP
2003-03-10 04:03:53 +03:00
The xmllint program parses one or more XML files, specified on the command line as \fI xmlfile\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\& .
2001-10-28 00:14:01 +04:00
.PP
2003-03-10 04:03:53 +03:00
It is included in libxml2\& .
2001-10-28 00:14:01 +04:00
.SH "OPTIONS"
.TP
\fB --version\fR
2003-03-10 04:03:53 +03:00
Display the version of libxml2 used\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --debug\fR
2003-03-10 04:03:53 +03:00
Parse a file and output an annotated tree of the in-memory version of the document\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --shell\fR
2003-03-10 04:03:53 +03:00
Run a navigating shell\& . Details on available commands in shell mode are below\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --debugent\fR
2003-03-10 04:03:53 +03:00
Debug the entities defined in the document\& .
2001-10-28 00:14:01 +04:00
.TP
2002-12-26 05:23:24 +03:00
\fB --copy\fR
2003-03-10 04:03:53 +03:00
Test the internal copy implementation\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --recover\fR
2003-03-10 04:03:53 +03:00
Output any parsable portions of an invalid document\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --noent\fR
2003-03-10 04:03:53 +03:00
Substitute entity values for entity references\& . By default, xmllint leaves entity references in place\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --noout\fR
2003-03-10 04:03:53 +03:00
Suppress output\& . By default, xmllint outputs the result tree\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --htmlout\fR
2003-03-10 04:03:53 +03:00
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\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --nowrap \fR
2003-03-10 04:03:53 +03:00
Do not output HTML doc wrapper\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --valid \fR
2003-03-10 04:03:53 +03:00
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\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --postvalid\fR
2003-03-10 04:03:53 +03:00
Validate after parsing is completed\& .
2001-10-28 00:14:01 +04:00
.TP
2002-12-26 05:23:24 +03:00
\fB --dtdvalid\fR \fI URL\fR
2003-03-10 04:03:53 +03:00
Use the DTD specified by \fI URL\fR for validation\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --timing\fR
2003-03-10 04:03:53 +03:00
Output information about the time it takes xmllint to perform the various steps\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --repeat\fR
2003-03-10 04:03:53 +03:00
Repeat 100 times, for timing or profiling\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --insert\fR
2003-03-10 04:03:53 +03:00
Test for valid insertions\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --compress\fR
2003-03-10 04:03:53 +03:00
Turn on gzip compression of output\& .
2001-10-28 00:14:01 +04:00
2001-11-04 23:13:58 +03:00
.TP
\fB --sgml\fR
2003-03-10 04:03:53 +03:00
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\& .
2001-11-04 23:13:58 +03:00
2001-10-28 00:14:01 +04:00
.TP
\fB --html\fR
2003-03-10 04:03:53 +03:00
Use the HTML parser\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --push\fR
2003-03-10 04:03:53 +03:00
Use the push mode of the parser\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --memory\fR
2003-03-10 04:03:53 +03:00
Parse from memory\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --nowarning\fR
2003-03-10 04:03:53 +03:00
Do not emit warnings from the parser and/or validator\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --noblanks\fR
2003-03-10 04:03:53 +03:00
Drop ignorable blank spaces\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --format\fR
2003-03-10 04:03:53 +03:00
Reformat and reindent the output\& . The $XMLLINT_INDENT environment variable controls the indentation (default value is two spaces "<22> <> ")\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --testIO\fR
2003-03-10 04:03:53 +03:00
Test user input/output support\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --encode\fR \fI encoding\fR
2003-03-10 04:03:53 +03:00
Output in the given encoding\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --catalogs\fR
2003-03-10 04:03:53 +03:00
Use the catalogs from $SGML_CATALOG_FILES\& . Otherwise /etc/xml/catalog is used by default\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --nocatalogs\fR
2003-03-10 04:03:53 +03:00
Do not use any catalogs\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --auto\fR
2003-03-10 04:03:53 +03:00
Generate a small document for testing purposes\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --xinclude\fR
2003-03-10 04:03:53 +03:00
Do XInclude processing\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --loaddtd\fR
2003-03-10 04:03:53 +03:00
Fetch external DTD\& .
2001-10-28 00:14:01 +04:00
.TP
\fB --dtdattr\fR
2003-03-10 04:03:53 +03:00
Fetch external DTD and populate the tree with inherited attributes\& .
2001-10-28 00:14:01 +04:00
2001-12-14 07:24:50 +03:00
.TP
\fB --dropdtd\fR
2003-03-10 04:03:53 +03:00
Remove DTD from output\& .
2001-12-14 07:24:50 +03:00
2003-01-07 06:54:25 +03:00
.TP
\fB --stream\fR
2003-03-10 04:03:53 +03:00
Use streaming API - useful for validation of files that are too large to be held in memory\& .
2003-01-07 06:54:25 +03:00
.TP
\fB --chkregister\fR
2003-03-10 04:03:53 +03:00
Turn on node registration\& . Useful for developeres testing libxml2 node tracking code\& .
2003-01-07 06:54:25 +03:00
2001-11-18 03:18:06 +03:00
.SH "SHELL"
.PP
2003-03-10 04:03:53 +03:00
xmllint offers an interactive shell mode invoked with the \fB --shell\fR command\& . Available commands in shell mode include:
2001-11-18 03:18:06 +03:00
.TP
\fB base\fR
display XML base of the node
.TP
\fB bye\fR
leave shell
.TP
2003-03-10 04:03:53 +03:00
\fB cat \fI node\fR \fR
Display node if given or current node\& .
2001-11-18 03:18:06 +03:00
.TP
2003-03-10 04:03:53 +03: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 03:18:06 +03:00
.TP
2003-03-10 04:03:53 +03:00
\fB dir \fI path\fR \fR
Dumps information about the node (namespace, attributes, content)\& .
2001-11-18 03:18:06 +03:00
.TP
2003-03-10 04:03:53 +03:00
\fB du \fI path\fR \fR
Show the structure of the subtree under path or the current node\& .
2001-11-18 03:18:06 +03:00
.TP
\fB exit\fR
2003-03-10 04:03:53 +03:00
Leave the shell\& .
2001-11-18 03:18:06 +03:00
.TP
\fB help\fR
2003-03-10 04:03:53 +03:00
Show this help\& .
2001-11-18 03:18:06 +03:00
.TP
\fB free\fR
2003-03-10 04:03:53 +03:00
Display memory usage\& .
2001-11-18 03:18:06 +03:00
.TP
2003-03-10 04:03:53 +03:00
\fB load \fI name\fR \fR
Load a new document with the given name\& .
2001-11-18 03:18:06 +03:00
.TP
2003-03-10 04:03:53 +03:00
\fB ls \fI path\fR \fR
List contents of \fI path\fR (if given) or the current directory\& .
2001-11-18 03:18:06 +03:00
.TP
\fB pwd\fR
2003-03-10 04:03:53 +03:00
Display the path to the current node\& .
2001-11-18 03:18:06 +03:00
.TP
\fB quit\fR
2003-03-10 04:03:53 +03:00
Leave the shell\& .
2001-11-18 03:18:06 +03:00
.TP
2003-03-10 04:03:53 +03:00
\fB save \fI name\fR \fR
Saves the current document to \fI name\fR if given or to the original name\& .
2001-11-18 03:18:06 +03:00
.TP
\fB validate\fR
2003-03-10 04:03:53 +03:00
Check the document for error\& .
2001-11-18 03:18:06 +03:00
.TP
2003-03-10 04:03:53 +03:00
\fB write \fI name\fR \fR
Write the current node to the given filename\& .
2001-11-18 03:18:06 +03:00
2002-12-26 05:23:24 +03:00
.SH "DEBUGGING CATALOGS"
.PP
2003-03-10 04:03:53 +03:00
Setting the environment variable \fI XML_DEBUG_CATALOG\fR using the command \fB "export XML_DEBUG_CATALOG="\fR outputs debugging information related to catalog operations\& .
2002-12-26 05:23:24 +03:00
.SH AUTHORS
John Fleck, Ziying Sherwin, Heiko Rupp.