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"
2004-02-27 06:26:30 +03:00
.ad l
.hy 0
.HP 8
\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 \- \- nocdata\fR | \fB \- \- nsclean\fR | \fB \- \- noout\fR | \fB \- \- htmlout\fR | \fB \- \- nowrap\fR | \fB \- \- valid\fR | \fB \- \- postvalid\fR | \fB \- \- dtdvalid\ \fI URL\fR \fR | \fB \- \- dtdvalidfpi\ \fI FPI\fR \fR | \fB \- \- timing\fR | \fB \- \- repeat\fR | \fB \- \- insert\fR | \fB \- \- compress\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 | \fB \- \- loaddtd\fR | \fB \- \- dtdattr\fR | \fB \- \- dropdtd\fR | \fB \- \- stream\fR | \fB \- \- chkregister\fR | \fB \- \- relaxng\fR | \fB \- \- schema\fR | \fB \- \- nonet\fR ] [\fB \fI xmlfile\fR \fR ]
.ad
.hy
2002-12-26 05:23:24 +03:00
2001-10-28 00:14:01 +04:00
.SH "INTRODUCTION"
.PP
2004-02-27 06:26:30 +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
2004-02-27 06:26:30 +03:00
It is included in libxml2\& .
2001-10-28 00:14:01 +04:00
.SH "OPTIONS"
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- version\fR
Display the version of libxml2 used\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- debug\fR
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
2004-02-27 06:26:30 +03:00
\fB \- \- shell\fR
Run a navigating shell\& . Details on available commands in shell mode are below\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- debugent\fR
Debug the entities defined in the document\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- copy\fR
Test the internal copy implementation\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- recover\fR
Output any parsable portions of an invalid document\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- noent\fR
Substitute entity values for entity references\& . By default, xmllint leaves entity references in place\& .
2001-10-28 00:14:01 +04:00
2003-09-26 17:53:14 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- nocdata\fR
Substitute CDATA section by equivalent text nodes\& .
2003-09-26 17:53:14 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- nsclean\fR
Remove redundant namespace declarations\& .
2003-09-26 17:53:14 +04:00
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- noout\fR
Suppress output\& . By default, xmllint outputs the result tree\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- htmlout\fR
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
2004-02-27 06:26:30 +03:00
\fB \- \- nowrap \fR
Do not output HTML doc wrapper\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03: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, xmllint also checks to determine if the document is well\- formed\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- postvalid\fR
Validate after parsing is completed\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- dtdvalid\fR \fI URL\fR
Use the DTD specified by \fI URL\fR for validation\& .
2001-10-28 00:14:01 +04:00
2003-08-18 20:39:51 +04:00
.TP
2004-02-27 06:26:30 +03: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 20:39:51 +04:00
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- timing\fR
Output information about the time it takes xmllint to perform the various steps\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- repeat\fR
Repeat 100 times, for timing or profiling\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- insert\fR
Test for valid insertions\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- compress\fR
Turn on gzip compression of output\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- html\fR
Use the HTML parser\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- push\fR
Use the push mode of the parser\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- memory\fR
Parse from memory\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- nowarning\fR
Do not emit warnings from the parser and/or validator\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- noblanks\fR
Drop ignorable blank spaces\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- format\fR
Reformat and reindent the output\& . The $XMLLINT_INDENT environment variable controls the indentation (default value is two spaces " ")\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- testIO\fR
Test user input/output support\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- encode\fR \fI encoding\fR
Output in the given encoding\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- catalogs\fR
Use the catalogs from $SGML_CATALOG_FILES\& . Otherwise /etc/xml/catalog is used by default\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- nocatalogs\fR
Do not use any catalogs\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- auto\fR
Generate a small document for testing purposes\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- xinclude\fR
Do XInclude processing\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- loaddtd\fR
Fetch external DTD\& .
2001-10-28 00:14:01 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- dtdattr\fR
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
2004-02-27 06:26:30 +03:00
\fB \- \- dropdtd\fR
Remove DTD from output\& .
2001-12-14 07:24:50 +03:00
2003-01-07 06:54:25 +03:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- stream\fR
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\& .
2003-01-07 06:54:25 +03:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- chkregister\fR
Turn on node registration\& . Useful for developeres testing libxml2 node tracking code\& .
2003-01-07 06:54:25 +03:00
2003-03-25 17:05:17 +03:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- relaxng\fR \fI schema\fR
Use RelaxNG file named \fI schema\fR for validation\& .
2003-03-25 17:05:17 +03:00
2003-05-14 02:14:13 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- schema\fR \fI schema\fR
Use a W3C XML Schema file named \fI schema\fR for validation\& .
2003-05-14 02:14:13 +04:00
.TP
2004-02-27 06:26:30 +03:00
\fB \- \- nonet\fR
Do not use the Internet to fetch DTD's or entities\& .
2003-05-14 02:14:13 +04:00
2001-11-18 03:18:06 +03:00
.SH "SHELL"
.PP
2004-02-27 06:26:30 +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
2004-02-27 06:26:30 +03:00
\fB cat \fI node\fR \fR
Display node if given or current node\& .
2001-11-18 03:18:06 +03:00
.TP
2004-02-27 06:26:30 +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
2004-02-27 06:26:30 +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
2004-02-27 06:26:30 +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
2004-02-27 06:26:30 +03:00
Leave the shell\& .
2001-11-18 03:18:06 +03:00
.TP
\fB help\fR
2004-02-27 06:26:30 +03:00
Show this help\& .
2001-11-18 03:18:06 +03:00
.TP
\fB free\fR
2004-02-27 06:26:30 +03:00
Display memory usage\& .
2001-11-18 03:18:06 +03:00
.TP
2004-02-27 06:26:30 +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
2004-02-27 06:26:30 +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
2004-02-27 06:26:30 +03:00
Display the path to the current node\& .
2001-11-18 03:18:06 +03:00
.TP
\fB quit\fR
2004-02-27 06:26:30 +03:00
Leave the shell\& .
2001-11-18 03:18:06 +03:00
.TP
2004-02-27 06:26:30 +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
2004-02-27 06:26:30 +03:00
Check the document for error\& .
2001-11-18 03:18:06 +03:00
.TP
2004-02-27 06:26:30 +03:00
\fB write \fI name\fR \fR
Write the current node to the given filename\& .
.SH "CATALOGS"
.PP
Catalog behavior can be changed by redirecting queries to the user's own set of catalogs\& . This can be done by setting the \fI 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\& .
2001-11-18 03:18:06 +03:00
2002-12-26 05:23:24 +03:00
.SH "DEBUGGING CATALOGS"
.PP
2004-02-27 06:26:30 +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.