Regenerate docs and testapi.c

This commit is contained in:
Nick Wellnhofer 2024-12-26 20:32:35 +01:00
parent 2e3a91a766
commit 0cf25b3de2
4 changed files with 579 additions and 278 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,12 +2,12 @@
.\" Title: xmllint
.\" Author: John Fleck <jfleck@inkstain.net>
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\" Date: 06/12/2024
.\" Date: 12/26/2024
.\" Manual: xmllint Manual
.\" Source: libxml2
.\" Language: English
.\"
.TH "XMLLINT" "1" "06/12/2024" "libxml2" "xmllint Manual"
.TH "XMLLINT" "1" "12/26/2024" "libxml2" "xmllint Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@ -31,9 +31,7 @@
xmllint \- command line XML tool
.SH "SYNOPSIS"
.HP \w'\fBxmllint\fR\ 'u
\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-quiet\fR | \fB\-\-shell\fR | \fB\-\-xpath\ "\fR\fB\fIXPath_expression\fR\fR\fB"\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-nodict\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ "\fR\fB\fIPATH(S)\fR\fR\fB"\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fR\fB\fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fR\fB\fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fR\fB\fIFILE\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-max\-ampl\ \fR\fB\fIINTEGER\fR\fR | \fB\-\-maxmem\ \fR\fB\fINBBYTES\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fR\fB\fIENCODING\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fR\fB\fIPATTERNVALUE\fR\fR | \fB\-\-relaxng\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schema\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-c14n\fR | \fB\-\-pedantic\fR] {\fIXML\-FILE(S)\fR... | \-}
.HP \w'\fBxmllint\fR\ 'u
\fBxmllint\fR \fB\-\-help\fR
\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-quiet\fR | \fB\-\-shell\fR | \fB\-\-xpath\ "\fR\fB\fIXPath_expression\fR\fR\fB"\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-huge\fR | \fB\-\-nocompact\fR | \fB\-\-nodefdtd\fR | \fB\-\-nodict\fR | \fB\-\-noenc\fR | \fB\-\-noent\fR | \fB\-\-nofixup\-base\-uris\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ "\fR\fB\fIPATH(S)\fR\fR\fB"\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fR\fB\fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fR\fB\fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fR\fB\fIFILE\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-max\-ampl\ \fR\fB\fIINTEGER\fR\fR | \fB\-\-maxmem\ \fR\fB\fINBBYTES\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-pretty\ \fR\fB\fIINTEGER\fR\fR | \fB\-\-encode\ \fR\fB\fIENCODING\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fR\fB\fIPATTERNVALUE\fR\fR | \fB\-\-relaxng\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schema\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schematron\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-c14n\fR | \fB\-\-c14n11\fR | \fB\-\-exc\-c14n\fR | \fB\-\-pedantic\fR | \fB\-\-sax\fR | \fB\-\-sax1\fR | \fB\-\-oldxml10\fR] {\fIXML\-FILE(S)\fR... | \-}
.SH "DESCRIPTION"
.PP
The
@ -89,7 +87,7 @@ compression of output\&.
Test the internal copy implementation\&.
.RE
.PP
\fB\-\-c14n\fR
\fB\-\-c14n\fR, \fB\-\-c14n11\fR, \fB\-\-exc\-c14n\fR
.RS 4
Use the W3C
XML
@ -151,12 +149,6 @@ Reformat and reindent the output\&. The
environment variable controls the indentation\&. The default value is two spaces " ")\&.
.RE
.PP
\fB\-\-help\fR
.RS 4
Print out a short usage summary for
\fBxmllint\fR\&.
.RE
.PP
\fB\-\-html\fR
.RS 4
Use the
@ -175,6 +167,11 @@ HTML
tags surrounding the result tree output so the results can be displayed/viewed in a browser\&.
.RE
.PP
\fB\-\-huge\fR
.RS 4
Ignore some hardcoded parser limits\&.
.RE
.PP
\fB\-\-insert\fR
.RS 4
Test for valid insertions\&.
@ -226,11 +223,26 @@ Do not use any catalogs\&.
Substitute CDATA section by equivalent text nodes\&.
.RE
.PP
\fB\-\-nocompact\fR
.RS 4
Do not generate compact text nodes (parser option XML_PARSE_COMPACT)\&. Only for debugging\&.
.RE
.PP
\fB\-\-nodefdtd\fR
.RS 4
Do not set default HTML doctype (parser option HTML_PARSE_NODEFDTD)\&.
.RE
.PP
\fB\-\-nodict\fR
.RS 4
Don\*(Aqt use dictionaries (parser option XML_PARSE_NODICT)\&. Only for debugging\&.
.RE
.PP
\fB\-\-noenc\fR
.RS 4
Ignore encoding declaration (parser option XML_PARSE_IGNORE_ENC)\&.
.RE
.PP
\fB\-\-noent\fR
.RS 4
Substitute entity values for entity references\&. By default,
@ -238,6 +250,11 @@ Substitute entity values for entity references\&. By default,
leaves entity references in place\&.
.RE
.PP
\fB\-\-nofixup\-base\-uris\fR
.RS 4
Don\*(Aqt fix xml:base URIs when processing XIncludes (parser option XML_PARSE_NOBASEFIX)\&.
.RE
.PP
\fB\-\-nonet\fR
.RS 4
Do not use the Internet to fetch
@ -273,6 +290,11 @@ Do XInclude processing but do not generate XInclude start and end nodes\&.
Remove redundant namespace declarations\&.
.RE
.PP
\fB\-\-oldxml10\fR
.RS 4
Use deprecated parsing rules before XML 1\&.0, 5th edition\&.
.RE
.PP
\fB\-\-output \fR\fB\fIFILE\fR\fR
.RS 4
Define a file path where
@ -306,6 +328,11 @@ Enable additional warnings\&.
Validate after parsing has completed\&.
.RE
.PP
\fB\-\-pretty \fR\fB\fIINTEGER\fR\fR
.RS 4
Value 0 means no formatting, 1 means XML_SAVE_FORMAT (same as \-\-format), 2 means XML_SAVE_WSNONSIG\&.
.RE
.PP
\fB\-\-push\fR
.RS 4
Use the push mode of the parser\&.
@ -333,6 +360,16 @@ for validation\&.
Repeat 100 times, for timing or profiling\&.
.RE
.PP
\fB\-\-sax\fR
.RS 4
Print SAX callbacks (only for debugging)\&.
.RE
.PP
\fB\-\-sax1\fR
.RS 4
Use deprecated SAX1 interface (only for debugging)\&.
.RE
.PP
\fB\-\-schema \fR\fB\fISCHEMA\fR\fR
.RS 4
Use a W3C
@ -342,6 +379,13 @@ Schema file named
for validation\&.
.RE
.PP
\fB\-\-schematron \fR\fB\fISCHEMA\fR\fR
.RS 4
Use a Schematron file named
\fISCHEMA\fR
for validation\&.
.RE
.PP
\fB\-\-shell\fR
.RS 4
Run a navigating shell\&. Details on available commands in shell mode are below (see

View File

@ -1,4 +1,4 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmllint</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry"><a name="idm1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xmllint &#8212; command line <acronym class="acronym">XML</acronym> tool</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xmllint</code> [ <code class="option">--version</code> | <code class="option">--debug</code> | <code class="option">--quiet</code> | <code class="option">--shell</code> | <code class="option">--xpath "<em class="replaceable"><code>XPath_expression</code></em>"</code> | <code class="option">--debugent</code> | <code class="option">--copy</code> | <code class="option">--recover</code> | <code class="option">--nodict</code> | <code class="option">--noent</code> | <code class="option">--noout</code> | <code class="option">--nonet</code> | <code class="option">--path "<em class="replaceable"><code>PATH(S)</code></em>"</code> | <code class="option">--load-trace</code> | <code class="option">--htmlout</code> | <code class="option">--nowrap</code> | <code class="option">--valid</code> | <code class="option">--postvalid</code> | <code class="option">--dtdvalid <em class="replaceable"><code>URL</code></em></code> | <code class="option">--dtdvalidfpi <em class="replaceable"><code>FPI</code></em></code> | <code class="option">--timing</code> | <code class="option">--output <em class="replaceable"><code>FILE</code></em></code> | <code class="option">--repeat</code> | <code class="option">--insert</code> | <code class="option">--compress</code> | <code class="option">--html</code> | <code class="option">--xmlout</code> | <code class="option">--push</code> | <code class="option">--memory</code> | <code class="option">--max-ampl <em class="replaceable"><code>INTEGER</code></em></code> | <code class="option">--maxmem <em class="replaceable"><code>NBBYTES</code></em></code> | <code class="option">--nowarning</code> | <code class="option">--noblanks</code> | <code class="option">--nocdata</code> | <code class="option">--format</code> | <code class="option">--encode <em class="replaceable"><code>ENCODING</code></em></code> | <code class="option">--dropdtd</code> | <code class="option">--nsclean</code> | <code class="option">--testIO</code> | <code class="option">--catalogs</code> | <code class="option">--nocatalogs</code> | <code class="option">--auto</code> | <code class="option">--xinclude</code> | <code class="option">--noxincludenode</code> | <code class="option">--loaddtd</code> | <code class="option">--dtdattr</code> | <code class="option">--stream</code> | <code class="option">--walker</code> | <code class="option">--pattern <em class="replaceable"><code>PATTERNVALUE</code></em></code> | <code class="option">--relaxng <em class="replaceable"><code>SCHEMA</code></em></code> | <code class="option">--schema <em class="replaceable"><code>SCHEMA</code></em></code> | <code class="option">--c14n</code> | <code class="option">--pedantic</code> ] { <em class="replaceable"><code>XML-FILE(S)</code></em>... | - }</p></div><div class="cmdsynopsis"><p><code class="command">xmllint</code> <code class="option">--help</code> </p></div></div><div class="refsect1"><a name="description"></a><h2>DESCRIPTION</h2><p>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmllint</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry"><a name="id1337"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xmllint &#8212; command line <acronym class="acronym">XML</acronym> tool</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xmllint</code> [ <code class="option">--version</code> | <code class="option">--debug</code> | <code class="option">--quiet</code> | <code class="option">--shell</code> | <code class="option">--xpath "<em class="replaceable"><code>XPath_expression</code></em>"</code> | <code class="option">--debugent</code> | <code class="option">--copy</code> | <code class="option">--recover</code> | <code class="option">--huge</code> | <code class="option">--nocompact</code> | <code class="option">--nodefdtd</code> | <code class="option">--nodict</code> | <code class="option">--noenc</code> | <code class="option">--noent</code> | <code class="option">--nofixup-base-uris</code> | <code class="option">--noout</code> | <code class="option">--nonet</code> | <code class="option">--path "<em class="replaceable"><code>PATH(S)</code></em>"</code> | <code class="option">--load-trace</code> | <code class="option">--htmlout</code> | <code class="option">--nowrap</code> | <code class="option">--valid</code> | <code class="option">--postvalid</code> | <code class="option">--dtdvalid <em class="replaceable"><code>URL</code></em></code> | <code class="option">--dtdvalidfpi <em class="replaceable"><code>FPI</code></em></code> | <code class="option">--timing</code> | <code class="option">--output <em class="replaceable"><code>FILE</code></em></code> | <code class="option">--repeat</code> | <code class="option">--insert</code> | <code class="option">--compress</code> | <code class="option">--html</code> | <code class="option">--xmlout</code> | <code class="option">--push</code> | <code class="option">--memory</code> | <code class="option">--max-ampl <em class="replaceable"><code>INTEGER</code></em></code> | <code class="option">--maxmem <em class="replaceable"><code>NBBYTES</code></em></code> | <code class="option">--nowarning</code> | <code class="option">--noblanks</code> | <code class="option">--nocdata</code> | <code class="option">--format</code> | <code class="option">--pretty <em class="replaceable"><code>INTEGER</code></em></code> | <code class="option">--encode <em class="replaceable"><code>ENCODING</code></em></code> | <code class="option">--dropdtd</code> | <code class="option">--nsclean</code> | <code class="option">--testIO</code> | <code class="option">--catalogs</code> | <code class="option">--nocatalogs</code> | <code class="option">--auto</code> | <code class="option">--xinclude</code> | <code class="option">--noxincludenode</code> | <code class="option">--loaddtd</code> | <code class="option">--dtdattr</code> | <code class="option">--stream</code> | <code class="option">--walker</code> | <code class="option">--pattern <em class="replaceable"><code>PATTERNVALUE</code></em></code> | <code class="option">--relaxng <em class="replaceable"><code>SCHEMA</code></em></code> | <code class="option">--schema <em class="replaceable"><code>SCHEMA</code></em></code> | <code class="option">--schematron <em class="replaceable"><code>SCHEMA</code></em></code> | <code class="option">--c14n</code> | <code class="option">--c14n11</code> | <code class="option">--exc-c14n</code> | <code class="option">--pedantic</code> | <code class="option">--sax</code> | <code class="option">--sax1</code> | <code class="option">--oldxml10</code> ] { <em class="replaceable"><code>XML-FILE(S)</code></em>... | - }</p></div></div><div class="refsect1"><a name="description"></a><h2>DESCRIPTION</h2><p>
The <span class="command"><strong>xmllint</strong></span> program parses one or more <acronym class="acronym">XML</acronym> files,
specified on the command line as <em class="replaceable"><code>XML-FILE</code></em>
(or the standard input if the filename provided
@ -15,7 +15,7 @@
<code class="filename">${sysconfdir}/xml/catalog</code> are used by default.
</p></dd><dt><span class="term"><code class="option">--compress</code></span></dt><dd><p>
Turn on <span class="citerefentry"><span class="refentrytitle">gzip</span>(1)</span> compression of output.
</p></dd><dt><span class="term"><code class="option">--copy</code></span></dt><dd><p>Test the internal copy implementation.</p></dd><dt><span class="term"><code class="option">--c14n</code></span></dt><dd><p>
</p></dd><dt><span class="term"><code class="option">--copy</code></span></dt><dd><p>Test the internal copy implementation.</p></dd><dt><span class="term"><code class="option">--c14n</code>, </span><span class="term"><code class="option">--c14n11</code>, </span><span class="term"><code class="option">--exc-c14n</code></span></dt><dd><p>
Use the W3C <acronym class="acronym">XML</acronym> Canonicalisation (<acronym class="acronym">C14N</acronym>) to
serialize the result of parsing to <code class="filename">stdout</code>.
It keeps comments in the result.
@ -36,12 +36,12 @@
Reformat and reindent the output. The <code class="envar">XMLLINT_INDENT</code>
environment variable controls the indentation. The default value is two
spaces " ").
</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print out a short usage summary for <span class="command"><strong>xmllint</strong></span>.</p></dd><dt><span class="term"><code class="option">--html</code></span></dt><dd><p>Use the <acronym class="acronym">HTML</acronym> parser.</p></dd><dt><span class="term"><code class="option">--htmlout</code></span></dt><dd><p>
</p></dd><dt><span class="term"><code class="option">--html</code></span></dt><dd><p>Use the <acronym class="acronym">HTML</acronym> parser.</p></dd><dt><span class="term"><code class="option">--htmlout</code></span></dt><dd><p>
Output results as an <acronym class="acronym">HTML</acronym> file. This
causes <span class="command"><strong>xmllint</strong></span> to output the necessary <acronym class="acronym">HTML</acronym>
tags surrounding the result tree output so the results can be
displayed/viewed in a browser.
</p></dd><dt><span class="term"><code class="option">--insert</code></span></dt><dd><p>Test for valid insertions.</p></dd><dt><span class="term"><code class="option">--loaddtd</code></span></dt><dd><p>Fetch an external <acronym class="acronym">DTD</acronym>.</p></dd><dt><span class="term"><code class="option">--load-trace</code></span></dt><dd><p>
</p></dd><dt><span class="term"><code class="option">--huge</code></span></dt><dd><p>Ignore some hardcoded parser limits.</p></dd><dt><span class="term"><code class="option">--insert</code></span></dt><dd><p>Test for valid insertions.</p></dd><dt><span class="term"><code class="option">--loaddtd</code></span></dt><dd><p>Fetch an external <acronym class="acronym">DTD</acronym>.</p></dd><dt><span class="term"><code class="option">--load-trace</code></span></dt><dd><p>
Display all the documents loaded during the processing
to <code class="filename">stderr</code>.
</p></dd><dt><span class="term"><code class="option">--max-ampl <em class="replaceable"><code>INTEGER</code></em></code></span></dt><dd><p>
@ -55,19 +55,34 @@
This can also be used to make sure batch processing
of <acronym class="acronym">XML</acronym> files will not exhaust the virtual memory
of the server running them.
</p></dd><dt><span class="term"><code class="option">--memory</code></span></dt><dd><p>Parse from memory.</p></dd><dt><span class="term"><code class="option">--noblanks</code></span></dt><dd><p>Drop ignorable blank spaces.</p></dd><dt><span class="term"><code class="option">--nocatalogs</code></span></dt><dd><p>Do not use any catalogs.</p></dd><dt><span class="term"><code class="option">--nocdata</code></span></dt><dd><p>Substitute CDATA section by equivalent text nodes.</p></dd><dt><span class="term"><code class="option">--nodict</code></span></dt><dd><p>
</p></dd><dt><span class="term"><code class="option">--memory</code></span></dt><dd><p>Parse from memory.</p></dd><dt><span class="term"><code class="option">--noblanks</code></span></dt><dd><p>Drop ignorable blank spaces.</p></dd><dt><span class="term"><code class="option">--nocatalogs</code></span></dt><dd><p>Do not use any catalogs.</p></dd><dt><span class="term"><code class="option">--nocdata</code></span></dt><dd><p>Substitute CDATA section by equivalent text nodes.</p></dd><dt><span class="term"><code class="option">--nocompact</code></span></dt><dd><p>
Do not generate compact text nodes (parser option
XML_PARSE_COMPACT). Only for debugging.
</p></dd><dt><span class="term"><code class="option">--nodefdtd</code></span></dt><dd><p>
Do not set default HTML doctype (parser option
HTML_PARSE_NODEFDTD).
</p></dd><dt><span class="term"><code class="option">--nodict</code></span></dt><dd><p>
Don't use dictionaries (parser option XML_PARSE_NODICT).
Only for debugging.
</p></dd><dt><span class="term"><code class="option">--noenc</code></span></dt><dd><p>
Ignore encoding declaration (parser option
XML_PARSE_IGNORE_ENC).
</p></dd><dt><span class="term"><code class="option">--noent</code></span></dt><dd><p>
Substitute entity values for entity references. By default, <span class="command"><strong>xmllint</strong></span>
leaves entity references in place.
</p></dd><dt><span class="term"><code class="option">--nofixup-base-uris</code></span></dt><dd><p>
Don't fix xml:base URIs when processing XIncludes
(parser option XML_PARSE_NOBASEFIX).
</p></dd><dt><span class="term"><code class="option">--nonet</code></span></dt><dd><p>
Do not use the Internet to fetch <acronym class="acronym">DTD</acronym>s or entities.
</p></dd><dt><span class="term"><code class="option">--noout</code></span></dt><dd><p>
Suppress output. By default, <span class="command"><strong>xmllint</strong></span> outputs the result tree.
</p></dd><dt><span class="term"><code class="option">--nowarning</code></span></dt><dd><p>Do not emit warnings from the parser and/or validator.</p></dd><dt><span class="term"><code class="option">--nowrap</code></span></dt><dd><p>Do not output <acronym class="acronym">HTML</acronym> doc wrapper.</p></dd><dt><span class="term"><code class="option">--noxincludenode</code></span></dt><dd><p>
Do XInclude processing but do not generate XInclude start and end nodes.
</p></dd><dt><span class="term"><code class="option">--nsclean</code></span></dt><dd><p>Remove redundant namespace declarations.</p></dd><dt><span class="term"><code class="option">--output <em class="replaceable"><code>FILE</code></em></code></span></dt><dd><p>
</p></dd><dt><span class="term"><code class="option">--nsclean</code></span></dt><dd><p>Remove redundant namespace declarations.</p></dd><dt><span class="term"><code class="option">--oldxml10</code></span></dt><dd><p>
Use deprecated parsing rules before XML 1.0,
5th edition.
</p></dd><dt><span class="term"><code class="option">--output <em class="replaceable"><code>FILE</code></em></code></span></dt><dd><p>
Define a file path where <span class="command"><strong>xmllint</strong></span> will save the result of parsing.
Usually the programs build a tree and save it
on <code class="filename">stdout</code>, with this option
@ -81,12 +96,18 @@
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.
</p></dd><dt><span class="term"><code class="option">--pedantic</code></span></dt><dd><p>Enable additional warnings.</p></dd><dt><span class="term"><code class="option">--postvalid</code></span></dt><dd><p>Validate after parsing has completed.</p></dd><dt><span class="term"><code class="option">--push</code></span></dt><dd><p>Use the push mode of the parser.</p></dd><dt><span class="term"><code class="option">--quiet</code></span></dt><dd><p>Don't print informational messages to stderr.</p></dd><dt><span class="term"><code class="option">--recover</code></span></dt><dd><p>Output any parsable portions of an invalid document.</p></dd><dt><span class="term"><code class="option">--relaxng <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
</p></dd><dt><span class="term"><code class="option">--pedantic</code></span></dt><dd><p>Enable additional warnings.</p></dd><dt><span class="term"><code class="option">--postvalid</code></span></dt><dd><p>Validate after parsing has completed.</p></dd><dt><span class="term"><code class="option">--pretty <em class="replaceable"><code>INTEGER</code></em></code></span></dt><dd><p>
Value 0 means no formatting, 1 means XML_SAVE_FORMAT
(same as --format), 2 means XML_SAVE_WSNONSIG.
</p></dd><dt><span class="term"><code class="option">--push</code></span></dt><dd><p>Use the push mode of the parser.</p></dd><dt><span class="term"><code class="option">--quiet</code></span></dt><dd><p>Don't print informational messages to stderr.</p></dd><dt><span class="term"><code class="option">--recover</code></span></dt><dd><p>Output any parsable portions of an invalid document.</p></dd><dt><span class="term"><code class="option">--relaxng <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
Use RelaxNG file named <em class="replaceable"><code>SCHEMA</code></em>
for validation.
</p></dd><dt><span class="term"><code class="option">--repeat</code></span></dt><dd><p>Repeat 100 times, for timing or profiling.</p></dd><dt><span class="term"><code class="option">--schema <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
</p></dd><dt><span class="term"><code class="option">--repeat</code></span></dt><dd><p>Repeat 100 times, for timing or profiling.</p></dd><dt><span class="term"><code class="option">--sax</code></span></dt><dd><p>Print SAX callbacks (only for debugging).</p></dd><dt><span class="term"><code class="option">--sax1</code></span></dt><dd><p>Use deprecated SAX1 interface (only for debugging).</p></dd><dt><span class="term"><code class="option">--schema <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
Use a W3C <acronym class="acronym">XML</acronym> Schema file
named <em class="replaceable"><code>SCHEMA</code></em> for validation.
</p></dd><dt><span class="term"><code class="option">--schematron <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
Use a Schematron file
named <em class="replaceable"><code>SCHEMA</code></em> for validation.
</p></dd><dt><span class="term"><code class="option">--shell</code></span></dt><dd><p>
Run a navigating shell. Details on available commands in shell mode
are below (see <a class="xref" href="#shell" title="SHELL COMMANDS">the section called &#8220;SHELL COMMANDS&#8221;</a>).

328
testapi.c
View File

@ -1849,6 +1849,47 @@ test_htmlCtxtReset(void) {
}
static int
test_htmlCtxtSetOptions(void) {
int test_ret = 0;
#if defined(LIBXML_HTML_ENABLED)
int mem_base;
int ret_val;
xmlParserCtxtPtr ctxt; /* an HTML parser context */
int n_ctxt;
int options; /* a bitmask of xmlParserOption values */
int n_options;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
for (n_options = 0;n_options < gen_nb_int;n_options++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
options = gen_int(n_options, 1);
ret_val = htmlCtxtSetOptions(ctxt, options);
desret_int(ret_val);
call_tests++;
des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
des_int(n_options, options, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in htmlCtxtSetOptions",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
printf(" %d", n_options);
printf("\n");
}
}
}
function_tests++;
#endif
return(test_ret);
}
static int
test_htmlCtxtUseOptions(void) {
int test_ret = 0;
@ -2916,7 +2957,7 @@ static int
test_HTMLparser(void) {
int test_ret = 0;
if (quiet == 0) printf("Testing HTMLparser : 36 of 42 functions ...\n");
if (quiet == 0) printf("Testing HTMLparser : 37 of 43 functions ...\n");
test_ret += test_UTF8ToHtml();
test_ret += test_htmlAttrAllowed();
test_ret += test_htmlAutoCloseTag();
@ -2928,6 +2969,7 @@ test_HTMLparser(void) {
test_ret += test_htmlCtxtReadFile();
test_ret += test_htmlCtxtReadMemory();
test_ret += test_htmlCtxtReset();
test_ret += test_htmlCtxtSetOptions();
test_ret += test_htmlCtxtUseOptions();
test_ret += test_htmlElementAllowedHere();
test_ret += test_htmlElementStatusHere();
@ -8905,7 +8947,7 @@ test_xmlEncodeSpecialChars(void) {
int mem_base;
xmlChar * ret_val;
const xmlDoc * doc; /* the document containing the string */
const xmlDoc * doc; /* unused */
int n_doc;
const xmlChar * input; /* A string to convert to XML. */
int n_input;
@ -11837,7 +11879,7 @@ test_xmlCtxtGetCatalogs(void) {
int mem_base;
void * ret_val;
xmlParserCtxtPtr ctxt; /* */
xmlParserCtxtPtr ctxt; /* parser context */
int n_ctxt;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
@ -11869,7 +11911,7 @@ test_xmlCtxtGetDeclaredEncoding(void) {
int mem_base;
const xmlChar * ret_val;
xmlParserCtxtPtr ctxt; /* */
xmlParserCtxtPtr ctxt; /* parser context */
int n_ctxt;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
@ -11933,7 +11975,7 @@ test_xmlCtxtGetPrivate(void) {
int mem_base;
void * ret_val;
xmlParserCtxtPtr ctxt; /* */
xmlParserCtxtPtr ctxt; /* parser context */
int n_ctxt;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
@ -11965,7 +12007,7 @@ test_xmlCtxtGetStandalone(void) {
int mem_base;
int ret_val;
xmlParserCtxtPtr ctxt; /* */
xmlParserCtxtPtr ctxt; /* parser context */
int n_ctxt;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
@ -12033,7 +12075,7 @@ test_xmlCtxtGetVersion(void) {
int mem_base;
const xmlChar * ret_val;
xmlParserCtxtPtr ctxt; /* */
xmlParserCtxtPtr ctxt; /* parser context */
int n_ctxt;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
@ -12151,6 +12193,61 @@ test_xmlCtxtParseDocument(void) {
}
static int
test_xmlCtxtParseDtd(void) {
int test_ret = 0;
#if defined(LIBXML_VALID_ENABLED)
int mem_base;
xmlDtdPtr ret_val;
xmlParserCtxtPtr ctxt; /* a parser context */
int n_ctxt;
xmlParserInputPtr input; /* a parser input */
int n_input;
const xmlChar * publicId; /* public ID of the DTD (optional) */
int n_publicId;
const xmlChar * systemId; /* system ID of the DTD (optional) */
int n_systemId;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
input = gen_xmlParserInputPtr(n_input, 1);
publicId = gen_const_xmlChar_ptr(n_publicId, 2);
systemId = gen_const_xmlChar_ptr(n_systemId, 3);
ret_val = xmlCtxtParseDtd(ctxt, input, publicId, systemId);
desret_xmlDtdPtr(ret_val);
call_tests++;
des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
des_xmlParserInputPtr(n_input, input, 1);
des_const_xmlChar_ptr(n_publicId, publicId, 2);
des_const_xmlChar_ptr(n_systemId, systemId, 3);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlCtxtParseDtd",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
printf(" %d", n_input);
printf(" %d", n_publicId);
printf(" %d", n_systemId);
printf("\n");
}
}
}
}
}
function_tests++;
#endif
return(test_ret);
}
static int
test_xmlCtxtReadDoc(void) {
int test_ret = 0;
@ -12432,9 +12529,9 @@ test_xmlCtxtSetCatalogs(void) {
int test_ret = 0;
int mem_base;
xmlParserCtxtPtr ctxt; /* */
xmlParserCtxtPtr ctxt; /* parser context */
int n_ctxt;
void * catalogs; /* */
void * catalogs; /* catalogs pointer */
int n_catalogs;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
@ -12479,9 +12576,9 @@ test_xmlCtxtSetDict(void) {
int test_ret = 0;
int mem_base;
xmlParserCtxtPtr ctxt; /* */
xmlParserCtxtPtr ctxt; /* parser context */
int n_ctxt;
xmlDictPtr dict; /* */
xmlDictPtr dict; /* dictionary */
int n_dict;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
@ -12575,9 +12672,9 @@ test_xmlCtxtSetPrivate(void) {
int test_ret = 0;
int mem_base;
xmlParserCtxtPtr ctxt; /* */
xmlParserCtxtPtr ctxt; /* parser context */
int n_ctxt;
void * priv; /* */
void * priv; /* private application data */
int n_priv;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
@ -12656,6 +12753,95 @@ test_xmlCtxtUseOptions(void) {
}
static int
test_xmlCtxtValidateDocument(void) {
int test_ret = 0;
#if defined(LIBXML_VALID_ENABLED)
int mem_base;
int ret_val;
xmlParserCtxtPtr ctxt; /* a parser context */
int n_ctxt;
xmlDocPtr doc; /* a document instance */
int n_doc;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
doc = gen_xmlDocPtr(n_doc, 1);
ret_val = xmlCtxtValidateDocument(ctxt, doc);
desret_int(ret_val);
call_tests++;
des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
des_xmlDocPtr(n_doc, doc, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlCtxtValidateDocument",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
printf(" %d", n_doc);
printf("\n");
}
}
}
function_tests++;
#endif
return(test_ret);
}
static int
test_xmlCtxtValidateDtd(void) {
int test_ret = 0;
#if defined(LIBXML_VALID_ENABLED)
int mem_base;
int ret_val;
xmlParserCtxtPtr ctxt; /* a parser context */
int n_ctxt;
xmlDocPtr doc; /* a document instance */
int n_doc;
xmlDtdPtr dtd; /* a dtd instance */
int n_dtd;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
doc = gen_xmlDocPtr(n_doc, 1);
dtd = gen_xmlDtdPtr(n_dtd, 2);
ret_val = xmlCtxtValidateDtd(ctxt, doc, dtd);
desret_int(ret_val);
call_tests++;
des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
des_xmlDocPtr(n_doc, doc, 1);
des_xmlDtdPtr(n_dtd, dtd, 2);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlCtxtValidateDtd",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
printf(" %d", n_doc);
printf(" %d", n_dtd);
printf("\n");
}
}
}
}
function_tests++;
#endif
return(test_ret);
}
static int
test_xmlGetExternalEntityLoader(void) {
int test_ret = 0;
@ -15335,7 +15521,7 @@ static int
test_parser(void) {
int test_ret = 0;
if (quiet == 0) printf("Testing parser : 86 of 102 functions ...\n");
if (quiet == 0) printf("Testing parser : 89 of 105 functions ...\n");
test_ret += test_xmlByteConsumed();
test_ret += test_xmlCleanupGlobals();
test_ret += test_xmlClearNodeInfoSeq();
@ -15351,6 +15537,7 @@ test_parser(void) {
test_ret += test_xmlCtxtGetVersion();
test_ret += test_xmlCtxtParseContent();
test_ret += test_xmlCtxtParseDocument();
test_ret += test_xmlCtxtParseDtd();
test_ret += test_xmlCtxtReadDoc();
test_ret += test_xmlCtxtReadFile();
test_ret += test_xmlCtxtReadMemory();
@ -15365,6 +15552,8 @@ test_parser(void) {
test_ret += test_xmlCtxtSetPrivate();
test_ret += test_xmlCtxtSetResourceLoader();
test_ret += test_xmlCtxtUseOptions();
test_ret += test_xmlCtxtValidateDocument();
test_ret += test_xmlCtxtValidateDtd();
test_ret += test_xmlGetExternalEntityLoader();
test_ret += test_xmlHasFeature();
test_ret += test_xmlIOParseDTD();
@ -15955,6 +16144,77 @@ test_xmlCtxtErrMemory(void) {
}
static int
test_xmlCtxtPopInput(void) {
int test_ret = 0;
int mem_base;
xmlParserInputPtr ret_val;
xmlParserCtxtPtr ctxt; /* an XML parser context */
int n_ctxt;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
ret_val = xmlCtxtPopInput(ctxt);
desret_xmlParserInputPtr(ret_val);
call_tests++;
des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlCtxtPopInput",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
printf("\n");
}
}
function_tests++;
return(test_ret);
}
static int
test_xmlCtxtPushInput(void) {
int test_ret = 0;
int mem_base;
int ret_val;
xmlParserCtxtPtr ctxt; /* an XML parser context */
int n_ctxt;
xmlParserInputPtr value; /* the parser input */
int n_value;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
value = gen_xmlParserInputPtr(n_value, 1);
ret_val = xmlCtxtPushInput(ctxt, value);
desret_int(ret_val);
call_tests++;
des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
des_xmlParserInputPtr(n_value, value, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlCtxtPushInput",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
printf(" %d", n_value);
printf("\n");
}
}
}
function_tests++;
return(test_ret);
}
static int
test_xmlCurrentChar(void) {
int test_ret = 0;
@ -16708,7 +16968,7 @@ static int
test_parserInternals(void) {
int test_ret = 0;
if (quiet == 0) printf("Testing parserInternals : 32 of 79 functions ...\n");
if (quiet == 0) printf("Testing parserInternals : 34 of 81 functions ...\n");
test_ret += test_inputPop();
test_ret += test_inputPush();
test_ret += test_namePop();
@ -16723,6 +16983,8 @@ test_parserInternals(void) {
test_ret += test_xmlCreateMemoryParserCtxt();
test_ret += test_xmlCreateURLParserCtxt();
test_ret += test_xmlCtxtErrMemory();
test_ret += test_xmlCtxtPopInput();
test_ret += test_xmlCtxtPushInput();
test_ret += test_xmlCurrentChar();
test_ret += test_xmlIsLetter();
test_ret += test_xmlNewEntityInputStream();
@ -22646,7 +22908,7 @@ test_xmlNodeListGetRawString(void) {
xmlChar * ret_val;
const xmlDoc * doc; /* a document (optional) */
int n_doc;
const xmlNode * list; /* a node list of attribute children (optional) */
const xmlNode * list; /* a node list of attribute children */
int n_list;
int inLine; /* whether entity references are substituted */
int n_inLine;
@ -22692,7 +22954,7 @@ test_xmlNodeListGetString(void) {
xmlChar * ret_val;
xmlDocPtr doc; /* a document (optional) */
int n_doc;
const xmlNode * list; /* a node list of attribute children (optional) */
const xmlNode * list; /* a node list of attribute children */
int n_list;
int inLine; /* whether entity references are substituted */
int n_inLine;
@ -26683,28 +26945,28 @@ test_xmlValidateDocument(void) {
#if defined(LIBXML_VALID_ENABLED)
int mem_base;
int ret_val;
xmlValidCtxtPtr ctxt; /* the validation context */
int n_ctxt;
xmlValidCtxtPtr vctxt; /* the validation context */
int n_vctxt;
xmlDocPtr doc; /* a document instance */
int n_doc;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
for (n_vctxt = 0;n_vctxt < gen_nb_xmlValidCtxtPtr;n_vctxt++) {
for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
vctxt = gen_xmlValidCtxtPtr(n_vctxt, 0);
doc = gen_xmlDocPtr(n_doc, 1);
ret_val = xmlValidateDocument(ctxt, doc);
ret_val = xmlValidateDocument(vctxt, doc);
desret_int(ret_val);
call_tests++;
des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
des_xmlValidCtxtPtr(n_vctxt, vctxt, 0);
des_xmlDocPtr(n_doc, doc, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlValidateDocument",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
printf(" %d", n_vctxt);
printf(" %d", n_doc);
printf("\n");
}
@ -28874,26 +29136,26 @@ test_xmlOutputBufferWrite(void) {
int n_out;
int len; /* the size in bytes of the array. */
int n_len;
const char * buf; /* an char array */
int n_buf;
const char * data; /* an char array */
int n_data;
for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
for (n_len = 0;n_len < gen_nb_int;n_len++) {
for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
mem_base = xmlMemBlocks();
out = gen_xmlOutputBufferPtr(n_out, 0);
len = gen_int(n_len, 1);
buf = gen_const_char_ptr(n_buf, 2);
if ((buf != NULL) &&
(len > xmlStrlen(BAD_CAST buf)))
data = gen_const_char_ptr(n_data, 2);
if ((data != NULL) &&
(len > xmlStrlen(BAD_CAST data)))
len = 0;
ret_val = xmlOutputBufferWrite(out, len, buf);
ret_val = xmlOutputBufferWrite(out, len, data);
desret_int(ret_val);
call_tests++;
des_xmlOutputBufferPtr(n_out, out, 0);
des_int(n_len, len, 1);
des_const_char_ptr(n_buf, buf, 2);
des_const_char_ptr(n_data, data, 2);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlOutputBufferWrite",
@ -28901,7 +29163,7 @@ test_xmlOutputBufferWrite(void) {
test_ret++;
printf(" %d", n_out);
printf(" %d", n_len);
printf(" %d", n_buf);
printf(" %d", n_data);
printf("\n");
}
}