'" t ." Title: xmllint ." Author: John Fleck <jfleck@inkstain.net> ." Generator: DocBook XSL Stylesheets v1.78.1 <docbook.sf.net/> ." Date: $Date$ ." Manual: xmllint Manual ." Source: libxml2 ." Language: English ." .TH “XMLLINT” “1” “$Date$” “libxml2” “xmllint Manual” ." —————————————————————– ." * Define some portability stuff ." —————————————————————– ." ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ." bugs.debian.org/507673 ." lists.gnu.org/archive/html/groff/2009-02/msg00013.html ." ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie n(.g .ds Aq (aq .el .ds Aq ' ." —————————————————————– ." * set default formatting ." —————————————————————– ." disable hyphenation .nh ." disable justification (adjust text to left margin only) .ad l ." —————————————————————– ." * MAIN CONTENT STARTS HERE * ." —————————————————————– .SH “NAME” xmllint - command line XML tool .SH “SYNOPSIS” .HP w'fBxmllintfR\ 'u fBxmllintfR [fB--versionfR | fB--debugfR | fB--shellfR | fB--xpath\ “fRfBfIXPath_expressionfRfRfB”fR | fB--debugentfR | fB--copyfR | fB--recoverfR | fB--noentfR | fB--nooutfR | fB--nonetfR | fB--path\ “fRfBfIPATH(S)fRfRfB”fR | fB--load-tracefR | fB--htmloutfR | fB--nowrapfR | fB--validfR | fB--postvalidfR | fB--dtdvalid\ fRfBfIURLfRfR | fB--dtdvalidfpi\ fRfBfIFPIfRfR | fB--timingfR | fB--output\ fRfBfIFILEfRfR | fB--repeatfR | fB--insertfR | fB--compressfR | fB--htmlfR | fB--xmloutfR | fB--pushfR | fB--memoryfR | fB--maxmem\ fRfBfINBBYTESfRfR | fB--nowarningfR | fB--noblanksfR | fB--nocdatafR | fB--formatfR | fB--encode\ fRfBfIENCODINGfRfR | fB--dropdtdfR | fB--nscleanfR | fB--testIOfR | fB--catalogsfR | fB--nocatalogsfR | fB--autofR | fB--xincludefR | fB--noxincludenodefR | fB--loaddtdfR | fB--dtdattrfR | fB--streamfR | fB--walkerfR | fB--pattern\ fRfBfIPATTERNVALUEfRfR | fB--chkregisterfR | fB--relaxng\ fRfBfISCHEMAfRfR | fB--schema\ fRfBfISCHEMAfRfR | fB--c14nfR] {fIXML-FILE(S)fR… | -} .HP w'fBxmllintfR\ 'u fBxmllintfR fB--helpfR .SH “DESCRIPTION” .PP The fBxmllintfR program parses one or more XML files, specified on the command line as fIXML-FILEfR (or the standard input if the filename provided is fB-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&. .PP fBxmllintfR is included in fBlibxmlfR(3)&. .SH “OPTIONS” .PP fBxmllintfR accepts the following options (in alphabetical order): .PP fB--autofR .RS 4 Generate a small document for testing purposes&. .RE .PP fB--catalogsfR .RS 4 Use the SGML catalog(s) from fBSGML_CATALOG_FILESfR&. Otherwise XML catalogs starting from /etc/xml/catalog are used by default&. .RE .PP fB--chkregisterfR .RS 4 Turn on node registration&. Useful for developers testing fBlibxmlfR(3) node tracking code&. .RE .PP fB--compressfR .RS 4 Turn on fBgzipfR(1) compression of output&. .RE .PP fB--copyfR .RS 4 Test the internal copy implementation&. .RE .PP fB--c14nfR .RS 4 Use the W3C XML Canonicalisation (C14N) to serialize the result of parsing to stdout&. It keeps comments in the result&. .RE .PP fB--dtdvalid fRfBfIURLfRfR .RS 4 Use the DTD specified by an fIURLfR for validation&. .RE .PP fB--dtdvalidfpi fRfBfIFPIfRfR .RS 4 Use the DTD specified by a Formal Public Identifier fIFPIfR for validation, note that this will require a catalog exporting that Formal Public Identifier to work&. .RE .PP fB--debugfR .RS 4 Parse a file and output an annotated tree of the in-memory version of the document&. .RE .PP fB--debugentfR .RS 4 Debug the entities defined in the document&. .RE .PP fB--dropdtdfR .RS 4 Remove DTD from output&. .RE .PP fB--dtdattrfR .RS 4 Fetch external DTD and populate the tree with inherited attributes&. .RE .PP fB--encode fRfBfIENCODINGfRfR .RS 4 Output in the given encoding&. Note that this works for full document not fragments or result from XPath queries&. .RE .PP fB--formatfR .RS 4 Reformat and reindent the output&. The fBXMLLINT_INDENTfR environment variable controls the indentation&. The default value is two spaces “ ”)&. .RE .PP fB--helpfR .RS 4 Print out a short usage summary for fBxmllintfR&. .RE .PP fB--htmlfR .RS 4 Use the HTML parser&. .RE .PP fB--htmloutfR .RS 4 Output results as an HTML file&. This causes fBxmllintfR to output the necessary HTML tags surrounding the result tree output so the results can be displayed/viewed in a browser&. .RE .PP fB--insertfR .RS 4 Test for valid insertions&. .RE .PP fB--loaddtdfR .RS 4 Fetch an external DTD&. .RE .PP fB--load-tracefR .RS 4 Display all the documents loaded during the processing to stderr&. .RE .PP fB--maxmem fRfBfINNBYTESfRfR .RS 4 Test the parser memory support&. fINNBYTESfR 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&. .RE .PP fB--memoryfR .RS 4 Parse from memory&. .RE .PP fB--noblanksfR .RS 4 Drop ignorable blank spaces&. .RE .PP fB--nocatalogsfR .RS 4 Do not use any catalogs&. .RE .PP fB--nocdatafR .RS 4 Substitute CDATA section by equivalent text nodes&. .RE .PP fB--noentfR .RS 4 Substitute entity values for entity references&. By default, fBxmllintfR leaves entity references in place&. .RE .PP fB--nonetfR .RS 4 Do not use the Internet to fetch DTDs or entities&. .RE .PP fB--nooutfR .RS 4 Suppress output&. By default, fBxmllintfR outputs the result tree&. .RE .PP fB--nowarningfR .RS 4 Do not emit warnings from the parser and/or validator&. .RE .PP fB--nowrapfR .RS 4 Do not output HTML doc wrapper&. .RE .PP fB--noxincludenodefR .RS 4 Do XInclude processing but do not generate XInclude start and end nodes&. .RE .PP fB--nscleanfR .RS 4 Remove redundant namespace declarations&. .RE .PP fB--output fRfBfIFILEfRfR .RS 4 Define a file path where fBxmllintfR 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&. .RE .PP fB--path “fRfBfIPATH(S)fRfRfB”fR .RS 4 Use the (space- or colon-separated) list of filesystem paths specified by fIPATHSfR to load DTDs or entities&. Enclose space-separated lists by quotation marks&. .RE .PP fB--pattern fRfBfIPATTERNVALUEfRfR .RS 4 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&. .RE .PP fB--postvalidfR .RS 4 Validate after parsing has completed&. .RE .PP fB--pushfR .RS 4 Use the push mode of the parser&. .RE .PP fB--recoverfR .RS 4 Output any parsable portions of an invalid document&. .RE .PP fB--relaxng fRfBfISCHEMAfRfR .RS 4 Use RelaxNG file named fISCHEMAfR for validation&. .RE .PP fB--repeatfR .RS 4 Repeat 100 times, for timing or profiling&. .RE .PP fB--schema fRfBfISCHEMAfRfR .RS 4 Use a W3C XML Schema file named fISCHEMAfR for validation&. .RE .PP fB--shellfR .RS 4 Run a navigating shell&. Details on available commands in shell mode are below (see the section called (lqSHELL COMMANDS(rq)&. .RE .PP fB--xpath “fRfBfIXPath_expressionfRfRfB”fR .RS 4 Run an XPath expression given as argument and print the result&. In case of a nodeset result, each node in the node set is serialized in full in the output&. In case of an empty node set the “XPath set is empty” result will be shown and an error exit code will be returned&. .RE .PP fB--streamfR .RS 4 Use streaming API - useful when used in combination with fB--relaxngfR or fB--validfR options for validation of files that are too large to be held in memory&. .RE .PP fB--testIOfR .RS 4 Test user input/output support&. .RE .PP fB--timingfR .RS 4 Output information about the time it takes fBxmllintfR to perform the various steps&. .RE .PP fB--validfR .RS 4 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--dtdvalidfR option&. By default, fBxmllintfR also checks to determine if the document is well-formed&. .RE .PP fB--versionfR .RS 4 Display the version of fBlibxmlfR(3) used&. .RE .PP fB--walkerfR .RS 4 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 an existing in-memory tree&. Used for debugging&. .RE .PP fB--xincludefR .RS 4 Do XInclude processing&. .RE .PP fB--xmloutfR .RS 4 Used in conjunction with fB--htmlfR&. 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&. .RE .SH “SHELL COMMANDS” .PP fBxmllintfR offers an interactive shell mode invoked with the fB--shellfR command&. Available commands in shell mode include (in alphabetical order): .PP fBbasefR .RS 4 Display XML base of the node&. .RE .PP fBbyefR .RS 4 Leave the shell&. .RE .PP fBcat fRfBfINODEfRfR .RS 4 Display the given node or the current one&. .RE .PP fBcd fRfBfIPATHfRfR .RS 4 Change the current node to the given path (if unique) or root if no argument is given&. .RE .PP fBdir fRfBfIPATHfRfR .RS 4 Dumps information about the node (namespace, attributes, content)&. .RE .PP fBdu fRfBfIPATHfRfR .RS 4 Show the structure of the subtree under the given path or the current node&. .RE .PP fBexitfR .RS 4 Leave the shell&. .RE .PP fBhelpfR .RS 4 Show this help&. .RE .PP fBfreefR .RS 4 Display memory usage&. .RE .PP fBload fRfBfIFILENAMEfRfR .RS 4 Load a new document with the given filename&. .RE .PP fBls fRfBfIPATHfRfR .RS 4 List contents of the given path or the current directory&. .RE .PP fBpwdfR .RS 4 Display the path to the current node&. .RE .PP fBquitfR .RS 4 Leave the shell&. .RE .PP fBsave fRfBfIFILENAMEfRfR .RS 4 Save the current document to the given filename or to the original name&. .RE .PP fBvalidatefR .RS 4 Check the document for errors&. .RE .PP fBwrite fRfBfIFILENAMEfRfR .RS 4 Write the current node to the given filename&. .RE .SH “ENVIRONMENT” .PP fBSGML_CATALOG_FILESfR .RS 4 SGML catalog behavior can be changed by redirecting queries to the user*(Aqs own set of catalogs&. This can be done by setting the fBSGML_CATALOG_FILESfR environment variable to a list of catalogs&. An empty one should deactivate loading the default /etc/sgml/catalog catalog&. .RE .PP fBXML_CATALOG_FILESfR .RS 4 XML catalog behavior can be changed by redirecting queries to the user*(Aqs own set of catalogs&. This can be done by setting the fBXML_CATALOG_FILESfR environment variable to a list of catalogs&. An empty one should deactivate loading the default /etc/xml/catalog catalog&. .RE .PP fBXML_DEBUG_CATALOGfR .RS 4 Setting the environment variable fBXML_DEBUG_CATALOGfR to fInon-zerofR using the fBexportfR command outputs debugging information related to catalog operations&. .RE .PP fBXMLLINT_INDENTfR .RS 4 Setting the environment variable fBXMLLINT_INDENTfR controls the indentation&. The default value is two spaces “ ”&. .RE .SH “DIAGNOSTICS” .PP fBxmllintfR return codes provide information that can be used when calling it from scripts&. .PP fB0fR .RS 4 No error .RE .PP fB1fR .RS 4 Unclassified .RE .PP fB2fR .RS 4 Error in DTD .RE .PP fB3fR .RS 4 Validation error .RE .PP fB4fR .RS 4 Validation error .RE .PP fB5fR .RS 4 Error in schema compilation .RE .PP fB6fR .RS 4 Error writing output .RE .PP fB7fR .RS 4 Error in pattern (generated when fB--patternfR option is used) .RE .PP fB8fR .RS 4 Error in Reader registration (generated when fB--chkregisterfR option is used) .RE .PP fB9fR .RS 4 Out of memory error .RE .SH “SEE ALSO” .PP fBlibxmlfR(3) .PP More information can be found at .sp .RS 4 .ie n {\ h'-04'(buh'+03'c .} .el {\ .sp -1 .IP (bu 2.3 .} fBlibxmlfR(3) web page m[blue]fB%www.xmlsoft.org/fRm[] .RE .sp .RS 4 .ie n {\ h'-04'(buh'+03'c .} .el {\ .sp -1 .IP (bu 2.3 .} W3C XSLT page m[blue]fB%www.w3.org/TR/xsltfRm[] .RE .sp .SH “AUTHORS” .PP fBJohn FleckfR <&jfleck@inkstain&.net&> .RS 4 Author. .RE .PP fBZiying SherwinfR <&sherwin@nlm&.nih&.gov&> .RS 4 Author. .RE .PP fBHeiko RuppfR <&hwr@pilhuhn&.de&> .RS 4 Author. .RE .SH “COPYRIGHT” .br Copyright (co 2001, 2004 .br