Blame doc/xmllint.html

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

xmllint is included in libxml(3).

OPTIONS

Packit Service a31ea6
		xmllint accepts the following options (in alphabetical order):
Packit Service a31ea6
	

--auto

Generate a small document for testing purposes.

--catalogs

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

--chkregister

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

--compress

Packit Service a31ea6
			Turn on gzip(1) compression of output.
Packit Service a31ea6
		

--copy

Test the internal copy implementation.

--c14n

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

--dtdvalid URL

Packit Service a31ea6
			Use the DTD specified by
Packit Service a31ea6
			an URL for validation.
Packit Service a31ea6
		

--dtdvalidfpi FPI

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

--debug

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

--debugent

Debug the entities defined in the document.

--dropdtd

Remove DTD from output.

--dtdattr

Packit Service a31ea6
			Fetch external DTD and populate the tree with
Packit Service a31ea6
			inherited attributes.
Packit Service a31ea6
		

--encode ENCODING

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

--format

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

--help

Print out a short usage summary for xmllint.

--html

Use the HTML parser.

--htmlout

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

--insert

Test for valid insertions.

--loaddtd

Fetch an external DTD.

--load-trace

Packit Service a31ea6
			Display all the documents loaded during the processing
Packit Service a31ea6
			to stderr.
Packit Service a31ea6
		

--maxmem NNBYTES

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

--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 Service a31ea6
			Substitute entity values for entity references. By default, xmllint
Packit Service a31ea6
			leaves entity references in place.
Packit Service a31ea6
		

--nonet

Packit Service a31ea6
			Do not use the Internet to fetch DTDs or entities.
Packit Service a31ea6
		

--noout

Packit Service a31ea6
			Suppress output. By default, xmllint outputs the result tree.
Packit Service a31ea6
		

--nowarning

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

--nowrap

Do not output HTML doc wrapper.

--noxincludenode

Packit Service a31ea6
			Do XInclude processing but do not generate XInclude start and end nodes.
Packit Service a31ea6
		

--nsclean

Remove redundant namespace declarations.

--output FILE

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

--path "PATH(S)"

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

--pattern PATTERNVALUE

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

--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 Service a31ea6
			Use RelaxNG file named SCHEMA
Packit Service a31ea6
			for validation.
Packit Service a31ea6
		

--repeat

Repeat 100 times, for timing or profiling.

--schema SCHEMA

Packit Service a31ea6
			Use a W3C XML Schema file
Packit Service a31ea6
			named SCHEMA for validation.
Packit Service a31ea6
		

--shell

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

--xpath "XPath_expression"

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

--stream

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

--testIO

Test user input/output support.

--timing

Packit Service a31ea6
			Output information about the time it takes xmllint to perform the
Packit Service a31ea6
			various steps.
Packit Service a31ea6
		

--valid

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

--version

Packit Service a31ea6
			Display the version of libxml(3) used.
Packit Service a31ea6
		

--walker

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

--xinclude

Do XInclude processing.

--xmlout

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

SHELL COMMANDS

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

base

Display XML base of the node.

bye

Leave the shell.

cat NODE

Display the given node or the current one.

cd PATH

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

dir PATH

Packit Service a31ea6
			Dumps information about the node (namespace, attributes, content).
Packit Service a31ea6
		

du PATH

Packit Service a31ea6
			Show the structure of the subtree under the given path or the current node.
Packit Service a31ea6
		

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 Service a31ea6
			Save the current document to the given filename or to the original name.
Packit Service a31ea6
		

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 Service a31ea6
			queries to the user's own set of catalogs. This can be done by setting
Packit Service a31ea6
			the SGML_CATALOG_FILES environment variable to a list
Packit Service a31ea6
			of catalogs. An empty one should deactivate loading the
Packit Service a31ea6
			default /etc/sgml/catalog catalog.
Packit Service a31ea6
		

XML_CATALOG_FILES

XML catalog behavior can be changed by redirecting

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

XML_DEBUG_CATALOG

Setting the environment variable XML_DEBUG_CATALOG

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

XMLLINT_INDENT

Setting the environment variable XMLLINT_INDENT

Packit Service a31ea6
			controls the indentation. The default value is two spaces "  ".
Packit Service a31ea6
		

DIAGNOSTICS

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

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 Service a31ea6
			Error in pattern (generated when --pattern option is used)
Packit Service a31ea6
		

8

Packit Service a31ea6
			Error in Reader registration (generated
Packit Service a31ea6
			when --chkregister option is used)
Packit Service a31ea6
		

9

Out of memory error

SEE ALSO

libxml(3)

Packit Service a31ea6
	

Packit Service a31ea6
		More information can be found at
Packit Service a31ea6
		

Packit Service a31ea6
				

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

  • Packit Service a31ea6
    				

    Packit Service a31ea6
    	

    </body></html>