Blame doc/xmllint.html

Packit 423ecb
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmllint</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">

Name

xmllint — command line XML tool

Synopsis

xmllint [ --version | --debug | --shell | --xpath "XPath_expression" | --debugent | --copy | --recover | --noent | --noout | --nonet | --path "PATH(S)" | --load-trace | --htmlout | --nowrap | --valid | --postvalid | --dtdvalid URL | --dtdvalidfpi FPI | --timing | --output FILE | --repeat | --insert | --compress | --html | --xmlout | --push | --memory | --maxmem NBBYTES | --nowarning | --noblanks | --nocdata | --format | --encode ENCODING | --dropdtd | --nsclean | --testIO | --catalogs | --nocatalogs | --auto | --xinclude | --noxincludenode | --loaddtd | --dtdattr | --stream | --walker | --pattern PATTERNVALUE | --chkregister | --relaxng SCHEMA | --schema SCHEMA | --c14n ] { XML-FILE(S)... | - }

xmllint --help

DESCRIPTION

Packit 423ecb
		The xmllint program parses one or more XML files,
Packit 423ecb
		specified on the command line as XML-FILE
Packit 423ecb
		(or the standard input if the filename provided
Packit 423ecb
		is - ). It prints various types of
Packit 423ecb
		output, depending upon the options selected. It is useful for detecting
Packit 423ecb
		errors both in XML code and in
Packit 423ecb
		the XML parser itself.
Packit 423ecb
	

xmllint is included in libxml(3).

OPTIONS

Packit 423ecb
		xmllint accepts the following options (in alphabetical order):
Packit 423ecb
	

--auto

Generate a small document for testing purposes.

--catalogs

Packit 423ecb
			Use the SGML catalog(s) from SGML_CATALOG_FILES.
Packit 423ecb
			Otherwise XML catalogs starting
Packit 423ecb
			from /etc/xml/catalog are used by default.
Packit 423ecb
		

--chkregister

Packit 423ecb
			Turn on node registration. Useful for developers testing libxml(3) node tracking code.
Packit 423ecb
		

--compress

Packit 423ecb
			Turn on gzip(1) compression of output.
Packit 423ecb
		

--copy

Test the internal copy implementation.

--c14n

Packit 423ecb
			Use the W3C XML Canonicalisation (C14N) to
Packit 423ecb
			serialize the result of parsing to stdout.
Packit 423ecb
			It keeps comments in the result.
Packit 423ecb
		

--dtdvalid URL

Packit 423ecb
			Use the DTD specified by
Packit 423ecb
			an URL for validation.
Packit 423ecb
		

--dtdvalidfpi FPI

Packit 423ecb
			Use the DTD specified by a Formal Public
Packit 423ecb
			Identifier FPI for validation, note that this
Packit 423ecb
			will require a catalog exporting that Formal Public Identifier to work.
Packit 423ecb
		

--debug

Packit 423ecb
			Parse a file and output an annotated tree of the
Packit 423ecb
			in-memory version of the document.
Packit 423ecb
		

--debugent

Debug the entities defined in the document.

--dropdtd

Remove DTD from output.

--dtdattr

Packit 423ecb
			Fetch external DTD and populate the tree with
Packit 423ecb
			inherited attributes.
Packit 423ecb
		

--encode ENCODING

Output in the given encoding. Note that this works for full document not fragments or result from XPath queries.

--format

Packit 423ecb
			Reformat and reindent the output. The XMLLINT_INDENT
Packit 423ecb
			environment variable controls the indentation. The default value is two
Packit 423ecb
			spaces "  ").
Packit 423ecb
		

--help

Print out a short usage summary for xmllint.

--html

Use the HTML parser.

--htmlout

Packit 423ecb
			Output results as an HTML file. This
Packit 423ecb
			causes xmllint to output the necessary HTML
Packit 423ecb
			tags surrounding the result tree output so the results can be
Packit 423ecb
			displayed/viewed in a browser.
Packit 423ecb
		

--insert

Test for valid insertions.

--loaddtd

Fetch an external DTD.

--load-trace

Packit 423ecb
			Display all the documents loaded during the processing
Packit 423ecb
			to stderr.
Packit 423ecb
		

--maxmem NNBYTES

Packit 423ecb
			Test the parser memory support. NNBYTES
Packit 423ecb
			is the maximum number of bytes the library is allowed to allocate.
Packit 423ecb
			This can also be used to make sure batch processing
Packit 423ecb
			of XML files will not exhaust the virtual memory
Packit 423ecb
			of the server running them.
Packit 423ecb
		

--memory

Parse from memory.

--noblanks

Drop ignorable blank spaces.

--nocatalogs

Do not use any catalogs.

--nocdata

Substitute CDATA section by equivalent text nodes.

--noent

Packit 423ecb
			Substitute entity values for entity references. By default, xmllint
Packit 423ecb
			leaves entity references in place.
Packit 423ecb
		

--nonet

Packit 423ecb
			Do not use the Internet to fetch DTDs or entities.
Packit 423ecb
		

--noout

Packit 423ecb
			Suppress output. By default, xmllint outputs the result tree.
Packit 423ecb
		

--nowarning

Do not emit warnings from the parser and/or validator.

--nowrap

Do not output HTML doc wrapper.

--noxincludenode

Packit 423ecb
			Do XInclude processing but do not generate XInclude start and end nodes.
Packit 423ecb
		

--nsclean

Remove redundant namespace declarations.

--output FILE

Packit 423ecb
			Define a file path where xmllint will save the result of parsing.
Packit 423ecb
			Usually the programs build a tree and save it
Packit 423ecb
			on stdout, with this option
Packit 423ecb
			the result XML instance will be saved onto a file.
Packit 423ecb
		

--path "PATH(S)"

Packit 423ecb
			Use the (space- or colon-separated) list of filesystem paths specified
Packit 423ecb
			by PATHS to load DTDs or
Packit 423ecb
			entities. Enclose space-separated lists by quotation marks.
Packit 423ecb
		

--pattern PATTERNVALUE

Packit 423ecb
			Used to exercise the pattern recognition engine, which can be used
Packit 423ecb
			with the reader interface to the parser. It allows to select some
Packit 423ecb
			nodes in the document based on an XPath (subset) expression. Used
Packit 423ecb
			for debugging.
Packit 423ecb
		

--postvalid

Validate after parsing has completed.

--push

Use the push mode of the parser.

--recover

Output any parsable portions of an invalid document.

--relaxng SCHEMA

Packit 423ecb
			Use RelaxNG file named SCHEMA
Packit 423ecb
			for validation.
Packit 423ecb
		

--repeat

Repeat 100 times, for timing or profiling.

--schema SCHEMA

Packit 423ecb
			Use a W3C XML Schema file
Packit 423ecb
			named SCHEMA for validation.
Packit 423ecb
		

--shell

Packit 423ecb
			Run a navigating shell. Details on available commands in shell mode
Packit 423ecb
			are below (see the section called “SHELL COMMANDS”).
Packit 423ecb
		

--xpath "XPath_expression"

Packit 423ecb
			Run an XPath expression given as argument and print the
Packit 423ecb
			result. In case of a nodeset result, each node in the
Packit 423ecb
			node set is serialized in full in the output. In case
Packit 423ecb
			of an empty node set the "XPath set is empty" result
Packit 423ecb
			will be shown and an error exit code will be returned.
Packit 423ecb
		

--stream

Packit 423ecb
			Use streaming API - useful when used in combination
Packit 423ecb
			with --relaxng or --valid options
Packit 423ecb
			for validation of files that are too large to be held in memory.
Packit 423ecb
		

--testIO

Test user input/output support.

--timing

Packit 423ecb
			Output information about the time it takes xmllint to perform the
Packit 423ecb
			various steps.
Packit 423ecb
		

--valid

Packit 423ecb
			Determine if the document is a valid instance of the included
Packit 423ecb
			Document Type Definition (DTD).
Packit 423ecb
			A DTD to be validated against also can be
Packit 423ecb
			specified at the command line using the --dtdvalid
Packit 423ecb
			option. By default, xmllint also checks to determine if the
Packit 423ecb
			document is well-formed.
Packit 423ecb
		

--version

Packit 423ecb
			Display the version of libxml(3) used.
Packit 423ecb
		

--walker

Packit 423ecb
			Test the walker module, which is a reader interface but for a
Packit 423ecb
			document tree, instead of using the reader API on
Packit 423ecb
			an unparsed document it works on an existing in-memory tree. Used for
Packit 423ecb
			debugging.
Packit 423ecb
		

--xinclude

Do XInclude processing.

--xmlout

Packit 423ecb
			Used in conjunction with --html. Usually
Packit 423ecb
			when HTML is parsed the document is saved with
Packit 423ecb
			the HTML serializer. But with this option the
Packit 423ecb
			resulting document is saved with the XML
Packit 423ecb
			serializer. This is primarily used to
Packit 423ecb
			generate XHTML from HTML input.
Packit 423ecb
		

SHELL COMMANDS

Packit 423ecb
		xmllint offers an interactive shell mode invoked with
Packit 423ecb
		the --shell command. Available commands in shell mode
Packit 423ecb
		include (in alphabetical order):
Packit 423ecb
	

base

Display XML base of the node.

bye

Leave the shell.

cat NODE

Display the given node or the current one.

cd PATH

Packit 423ecb
			Change the current node to the given path (if unique) or root if no
Packit 423ecb
			argument is given.
Packit 423ecb
		

dir PATH

Packit 423ecb
			Dumps information about the node (namespace, attributes, content).
Packit 423ecb
		

du PATH

Packit 423ecb
			Show the structure of the subtree under the given path or the current node.
Packit 423ecb
		

exit

Leave the shell.

help

Show this help.

free

Display memory usage.

load FILENAME

Load a new document with the given filename.

ls PATH

List contents of the given path or the current directory.

pwd

Display the path to the current node.

quit

Leave the shell.

save FILENAME

Packit 423ecb
			Save the current document to the given filename or to the original name.
Packit 423ecb
		

validate

Check the document for errors.

write FILENAME

Write the current node to the given filename.

ENVIRONMENT

SGML_CATALOG_FILES

SGML catalog behavior can be changed by redirecting

Packit 423ecb
			queries to the user's own set of catalogs. This can be done by setting
Packit 423ecb
			the SGML_CATALOG_FILES environment variable to a list
Packit 423ecb
			of catalogs. An empty one should deactivate loading the
Packit 423ecb
			default /etc/sgml/catalog catalog.
Packit 423ecb
		

XML_CATALOG_FILES

XML catalog behavior can be changed by redirecting

Packit 423ecb
			queries to the user's own set of catalogs. This can be done by setting
Packit 423ecb
			the XML_CATALOG_FILES environment variable to a list
Packit 423ecb
			of catalogs. An empty one should deactivate loading the
Packit 423ecb
			default /etc/xml/catalog catalog.
Packit 423ecb
		

XML_DEBUG_CATALOG

Setting the environment variable XML_DEBUG_CATALOG

Packit 423ecb
			to non-zero using the export
Packit 423ecb
			command outputs debugging information related to catalog operations.
Packit 423ecb
		

XMLLINT_INDENT

Setting the environment variable XMLLINT_INDENT

Packit 423ecb
			controls the indentation. The default value is two spaces "  ".
Packit 423ecb
		

DIAGNOSTICS

Packit 423ecb
		xmllint return codes provide information that can be used when
Packit 423ecb
		calling it from scripts.
Packit 423ecb
	

0

No error

1

Unclassified

2

Error in DTD

3

Validation error

4

Validation error

5

Error in schema compilation

6

Error writing output

7

Packit 423ecb
			Error in pattern (generated when --pattern option is used)
Packit 423ecb
		

8

Packit 423ecb
			Error in Reader registration (generated
Packit 423ecb
			when --chkregister option is used)
Packit 423ecb
		

9

Out of memory error

SEE ALSO

libxml(3)

Packit 423ecb
	

Packit 423ecb
		More information can be found at
Packit 423ecb
		

Packit 423ecb
				

  • W3C XSLT page http://www.w3.org/TR/xslt

  • Packit 423ecb
    				

    Packit 423ecb
    	

    </body></html>