MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
Daniel Veillard | fd58341 | 2003-04-25 13:22:10 +0000 | [diff] [blame] | 2 | <?xml-stylesheet type="text/xsl" |
| 3 | href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 4 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" |
| 5 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ |
| 6 | ]> |
| 7 | <refentry> |
| 8 | <refentryinfo> |
| 9 | <title>xmllint Manual</title> |
| 10 | <copyright> |
| 11 | <year>2001</year> |
| 12 | </copyright> |
MST 2004 John Fleck | e42ae6f | 2004-02-27 03:26:30 +0000 | [diff] [blame] | 13 | <copyright> |
| 14 | <year>2004</year> |
| 15 | </copyright> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 16 | <author> |
| 17 | <firstname>John</firstname> |
| 18 | <surname>Fleck</surname> |
| 19 | </author> |
| 20 | <address><email>jfleck@inkstain.net</email></address> |
| 21 | <author> |
| 22 | <firstname>Ziying</firstname> |
| 23 | <surname>Sherwin</surname> |
| 24 | </author> |
| 25 | <address><email>sherwin@nlm.nih.gov</email></address> |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 26 | <author> |
| 27 | <firstname>Heiko</firstname> |
| 28 | <surname>Rupp</surname> |
| 29 | </author> |
| 30 | <address><email>hwr@pilhuhn.de</email></address> |
MST 2001 John Fleck | 3fc555e | 2001-12-11 04:41:24 +0000 | [diff] [blame] | 31 | |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 32 | <releaseinfo>This is release 0.5 of the xmllint Manual.</releaseinfo> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 33 | </refentryinfo> |
| 34 | |
| 35 | <refmeta> |
| 36 | <refentrytitle>xmllint</refentrytitle> |
| 37 | <manvolnum>1</manvolnum> |
| 38 | </refmeta> |
| 39 | |
| 40 | <refnamediv> |
| 41 | <refname>xmllint</refname> |
| 42 | <refpurpose>command line <acronym>XML</acronym> tool</refpurpose> |
| 43 | </refnamediv> |
| 44 | |
| 45 | <refsynopsisdiv> |
| 46 | <cmdsynopsis> |
| 47 | <command>xmllint</command> |
| 48 | <group> |
| 49 | <arg>--version</arg> |
| 50 | <arg>--debug</arg> |
| 51 | <arg>--shell</arg> |
| 52 | <arg>--debugent</arg> |
| 53 | <arg>--copy</arg> |
| 54 | <arg>--recover</arg> |
| 55 | <arg>--noent</arg> |
| 56 | <arg>--noout</arg> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 57 | <arg>--nonet</arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 58 | <arg>--htmlout</arg> |
| 59 | <arg>--nowrap</arg> |
| 60 | <arg>--valid</arg> |
| 61 | <arg>--postvalid</arg> |
| 62 | <arg>--dtdvalid <replaceable>URL</replaceable></arg> |
Daniel Veillard | 66f68e7 | 2003-08-18 16:39:51 +0000 | [diff] [blame] | 63 | <arg>--dtdvalidfpi <replaceable>FPI</replaceable></arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 64 | <arg>--timing</arg> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 65 | <arg>--output <replaceable>file</replaceable></arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 66 | <arg>--repeat</arg> |
| 67 | <arg>--insert</arg> |
| 68 | <arg>--compress</arg> |
| 69 | <arg>--html</arg> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 70 | <arg>--xmlout</arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 71 | <arg>--push</arg> |
| 72 | <arg>--memory</arg> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 73 | <arg>--maxmem <replaceable>nbbytes</replaceable></arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 74 | <arg>--nowarning</arg> |
| 75 | <arg>--noblanks</arg> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 76 | <arg>--nocdata</arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 77 | <arg>--format</arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 78 | <arg>--encode <replaceable>encoding</replaceable></arg> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 79 | <arg>--dropdtd</arg> |
| 80 | <arg>--nsclean</arg> |
| 81 | <arg>--testIO</arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 82 | <arg>--catalogs</arg> |
| 83 | <arg>--nocatalogs</arg> |
| 84 | <arg>--auto</arg> |
| 85 | <arg>--xinclude</arg> |
| 86 | <arg>--loaddtd</arg> |
| 87 | <arg>--dtdattr</arg> |
MST 2003 John Fleck | 7e54be1 | 2003-01-07 03:54:25 +0000 | [diff] [blame] | 88 | <arg>--stream</arg> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 89 | <arg>--walker</arg> |
| 90 | <arg>--pattern <replaceable>patternvalue</replaceable></arg> |
MST 2003 John Fleck | 7e54be1 | 2003-01-07 03:54:25 +0000 | [diff] [blame] | 91 | <arg>--chkregister</arg> |
MST 2003 John Fleck | da27174 | 2003-03-25 14:05:17 +0000 | [diff] [blame] | 92 | <arg>--relaxng</arg> |
Daniel Veillard | e8b09e4 | 2003-05-13 22:14:13 +0000 | [diff] [blame] | 93 | <arg>--schema</arg> |
MDT 2004 John Fleck | 774a3bd | 2004-08-15 00:54:21 +0000 | [diff] [blame^] | 94 | <arg>--c14n</arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 95 | </group> |
| 96 | <arg><option><replaceable>xmlfile</replaceable></option></arg> |
| 97 | </cmdsynopsis> |
| 98 | </refsynopsisdiv> |
| 99 | |
| 100 | <refsect1 id="introduction"> |
| 101 | <title>Introduction</title> |
| 102 | <para> |
| 103 | The xmllint program parses one or more XML files, specified on the |
| 104 | command line as <replaceable>xmlfile</replaceable>. It prints various |
| 105 | types of output, depending upon the options selected. It is useful for |
| 106 | detecting errors both in <acronym>XML</acronym> code and in the |
| 107 | <acronym>XML</acronym> parser itself. |
| 108 | </para> |
| 109 | |
| 110 | <para> |
| 111 | It is included in <application>libxml2</application>. |
| 112 | </para> |
| 113 | </refsect1> |
| 114 | <refsect1 id="options"> |
| 115 | <title>Options</title> |
| 116 | <variablelist> |
| 117 | <varlistentry> |
| 118 | <term><option>--version</option></term> |
| 119 | <listitem> |
| 120 | <simpara> |
| 121 | Display the version of |
| 122 | <application>libxml2</application> used. |
| 123 | </simpara> |
| 124 | </listitem> |
| 125 | </varlistentry> |
| 126 | |
| 127 | <varlistentry> |
| 128 | <term><option>--debug</option></term> |
| 129 | <listitem> |
| 130 | <simpara> |
| 131 | Parse a file and output an annotated tree of the |
| 132 | in-memory version of the document. |
| 133 | </simpara> |
| 134 | </listitem> |
| 135 | </varlistentry> |
| 136 | |
| 137 | <varlistentry> |
| 138 | <term><option>--shell</option></term> |
| 139 | <listitem> |
| 140 | <simpara> |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 141 | Run a navigating shell. Details on available commands in shell mode |
| 142 | are below. |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 143 | </simpara> |
| 144 | </listitem> |
| 145 | </varlistentry> |
| 146 | |
| 147 | <varlistentry> |
| 148 | <term><option>--debugent</option></term> |
| 149 | <listitem> |
| 150 | <simpara> |
| 151 | Debug the entities defined in the document. |
| 152 | </simpara> |
| 153 | </listitem> |
| 154 | </varlistentry> |
| 155 | |
| 156 | <varlistentry> |
| 157 | <term><option>--copy</option> </term> |
| 158 | <listitem> |
| 159 | <simpara> |
| 160 | Test the internal copy implementation. |
| 161 | </simpara> |
| 162 | </listitem> |
| 163 | </varlistentry> |
| 164 | |
| 165 | |
| 166 | <varlistentry> |
| 167 | <term><option>--recover</option></term> |
| 168 | <listitem> |
| 169 | <simpara> |
| 170 | Output any parsable portions of an invalid |
| 171 | document. |
| 172 | </simpara> |
| 173 | </listitem> |
| 174 | </varlistentry> |
| 175 | |
| 176 | <varlistentry> |
| 177 | <term><option>--noent</option></term> |
| 178 | <listitem> |
| 179 | <simpara> |
| 180 | Substitute entity values for entity |
| 181 | references. By default, <application>xmllint</application> leaves entity |
| 182 | references in place. |
| 183 | </simpara> |
| 184 | </listitem> |
| 185 | </varlistentry> |
| 186 | |
| 187 | <varlistentry> |
Daniel Veillard | dca8cc7 | 2003-09-26 13:53:14 +0000 | [diff] [blame] | 188 | <term><option>--nocdata</option></term> |
| 189 | <listitem> |
| 190 | <simpara> |
| 191 | Substitute CDATA section by equivalent text nodes. |
| 192 | </simpara> |
| 193 | </listitem> |
| 194 | </varlistentry> |
| 195 | |
| 196 | <varlistentry> |
| 197 | <term><option>--nsclean</option></term> |
| 198 | <listitem> |
| 199 | <simpara> |
| 200 | Remove redundant namespace declarations. |
| 201 | </simpara> |
| 202 | </listitem> |
| 203 | </varlistentry> |
| 204 | |
| 205 | <varlistentry> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 206 | <term><option>--noout</option></term> |
| 207 | <listitem> |
| 208 | <simpara> |
| 209 | Suppress output. By default, |
| 210 | <application>xmllint</application> outputs the result tree. |
| 211 | </simpara> |
| 212 | </listitem> |
| 213 | </varlistentry> |
| 214 | |
| 215 | <varlistentry> |
| 216 | <term><option>--htmlout</option></term> |
| 217 | <listitem> |
| 218 | <simpara> |
| 219 | Output results as an <acronym>HTML</acronym> |
| 220 | file. This causes <application>xmllint</application> to output |
| 221 | the necessary <acronym>HTML</acronym> tags surrounding the result tree |
| 222 | output so the results can be displayed in a browser. |
| 223 | </simpara> |
| 224 | </listitem> |
| 225 | </varlistentry> |
| 226 | |
| 227 | <varlistentry> |
| 228 | <term><option>--nowrap </option></term> |
| 229 | <listitem> |
| 230 | <simpara> |
| 231 | Do not output HTML doc wrapper. |
| 232 | </simpara> |
| 233 | </listitem> |
| 234 | </varlistentry> |
| 235 | |
| 236 | <varlistentry> |
| 237 | <term><option>--valid </option></term> |
| 238 | <listitem> |
| 239 | <simpara> |
| 240 | Determine if the document is a valid instance |
| 241 | of the included Document Type Definition (<acronym>DTD</acronym>). A |
| 242 | <acronym>DTD</acronym> to be validated against also can be specified at |
| 243 | the command line using the <option>--dtdvalid</option> option. By default, |
| 244 | <application>xmllint</application> also checks to determine if the |
| 245 | document is well-formed. |
| 246 | </simpara> |
| 247 | </listitem> |
| 248 | </varlistentry> |
| 249 | |
| 250 | <varlistentry> |
| 251 | <term><option>--postvalid</option></term> |
| 252 | <listitem> |
| 253 | <simpara> |
| 254 | Validate after parsing is completed. |
| 255 | </simpara> |
| 256 | </listitem> |
| 257 | </varlistentry> |
| 258 | |
| 259 | <varlistentry> |
| 260 | <term> <option>--dtdvalid</option> <replaceable>URL</replaceable></term> |
| 261 | <listitem> |
| 262 | <simpara> |
| 263 | Use the |
| 264 | <acronym>DTD</acronym> specified by <replaceable>URL</replaceable> for |
| 265 | validation. |
| 266 | </simpara> |
| 267 | </listitem> |
| 268 | </varlistentry> |
| 269 | |
Daniel Veillard | 66f68e7 | 2003-08-18 16:39:51 +0000 | [diff] [blame] | 270 | <varlistentry> |
| 271 | <term> <option>--dtdvalidfpi</option> <replaceable>FPI</replaceable></term> |
| 272 | <listitem> |
| 273 | <simpara> |
| 274 | Use the |
| 275 | <acronym>DTD</acronym> specified by the Public Identifier |
| 276 | <replaceable>FPI</replaceable> for validation, note that this |
| 277 | will require a Catalog exporting that Public Identifier to work. |
| 278 | </simpara> |
| 279 | </listitem> |
| 280 | </varlistentry> |
| 281 | |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 282 | <varlistentry> |
| 283 | <term><option>--timing</option></term> |
| 284 | <listitem> |
| 285 | <simpara> |
| 286 | Output information about the time it takes |
| 287 | <application>xmllint</application> to perform the various steps. |
| 288 | </simpara> |
| 289 | </listitem> |
| 290 | </varlistentry> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 291 | <varlistentry> |
| 292 | <term><option>--output</option> <replaceable>file</replaceable></term> |
| 293 | <listitem> |
| 294 | <simpara>Define a file path where xmllint will save the result of |
| 295 | parsing. Usually the programs build a tree and save it on stdout, with |
| 296 | this option the result XML instance will be saved onto a file.</simpara> |
| 297 | </listitem> |
| 298 | </varlistentry> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 299 | <varlistentry> |
| 300 | <term><option>--repeat</option></term> |
| 301 | <listitem> |
| 302 | <simpara> |
| 303 | Repeat 100 times, for timing or profiling. |
| 304 | </simpara> |
| 305 | </listitem> |
| 306 | </varlistentry> |
| 307 | |
| 308 | <varlistentry> |
| 309 | <term><option>--insert</option></term> |
| 310 | <listitem> |
| 311 | <simpara> |
| 312 | Test for valid insertions. |
| 313 | </simpara> |
| 314 | </listitem> |
| 315 | </varlistentry> |
| 316 | |
| 317 | <varlistentry> |
| 318 | <term><option>--compress</option></term> |
| 319 | <listitem> |
| 320 | <simpara> |
| 321 | Turn on gzip compression of output. |
| 322 | </simpara> |
| 323 | </listitem> |
| 324 | </varlistentry> |
| 325 | |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 326 | <varlistentry> |
| 327 | <term><option>--html</option></term> |
| 328 | <listitem> |
| 329 | <simpara> |
| 330 | Use the <acronym>HTML</acronym> parser. |
| 331 | </simpara> |
| 332 | </listitem> |
| 333 | </varlistentry> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 334 | <varlistentry> |
| 335 | <term><option>--xmlout</option></term> |
| 336 | <listitem> |
| 337 | <simpara>Used in conjusntion with <option>--html</option>. Usually |
| 338 | when HTML is parsed the document is saved with the HTML serializer, but with |
| 339 | this option the resulting document is saved with the XML serializer. This is |
| 340 | primarily used to generate XHTML from HTML input.</simpara> |
| 341 | </listitem> |
| 342 | </varlistentry> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 343 | <varlistentry> |
| 344 | <term><option>--push</option></term> |
| 345 | <listitem> |
| 346 | <simpara> |
| 347 | Use the push mode of the parser. |
| 348 | </simpara> |
| 349 | </listitem> |
| 350 | </varlistentry> |
| 351 | |
| 352 | |
| 353 | <varlistentry> |
| 354 | <term><option>--memory</option></term> |
| 355 | <listitem> |
| 356 | <simpara> |
| 357 | Parse from memory. |
| 358 | </simpara> |
| 359 | </listitem> |
| 360 | </varlistentry> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 361 | <varlistentry> |
| 362 | <term><option>--maxmem</option> <replaceable>nnbytes</replaceable></term> |
| 363 | <listitem> |
| 364 | <simpara>Test the parser memory |
| 365 | support. <replaceable>nnbytes</replaceable> is the maximum number of bytes the |
| 366 | library is allowed to allocate. This can also be used to make sure batch |
| 367 | processing of XML files will not exhaust the virtual memory of the server |
| 368 | running them.</simpara> |
| 369 | </listitem> |
| 370 | </varlistentry> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 371 | <varlistentry> |
| 372 | <term><option>--nowarning</option></term> |
| 373 | <listitem> |
| 374 | <simpara> |
| 375 | Do not emit warnings from the parser and/or validator. |
| 376 | </simpara> |
| 377 | </listitem> |
| 378 | </varlistentry> |
| 379 | |
| 380 | <varlistentry> |
| 381 | <term><option>--noblanks</option></term> |
| 382 | <listitem> |
| 383 | <simpara> |
| 384 | Drop ignorable blank spaces. |
| 385 | </simpara> |
| 386 | </listitem> |
| 387 | </varlistentry> |
| 388 | |
| 389 | <varlistentry> |
| 390 | <term><option>--format</option></term> |
| 391 | <listitem> |
| 392 | <simpara> |
Aleksey Sanin | 693c9bc | 2003-03-09 22:36:52 +0000 | [diff] [blame] | 393 | Reformat and reindent the output. The $XMLLINT_INDENT |
| 394 | environment variable controls the indentation (default |
Daniel Veillard | dc07e18 | 2003-04-25 10:39:38 +0000 | [diff] [blame] | 395 | value is two spaces " "). |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 396 | </simpara> |
| 397 | </listitem> |
| 398 | </varlistentry> |
| 399 | |
| 400 | <varlistentry> |
| 401 | <term><option>--testIO</option></term> |
| 402 | <listitem> |
| 403 | <simpara> |
| 404 | Test user input/output support. |
| 405 | </simpara> |
| 406 | </listitem> |
| 407 | </varlistentry> |
| 408 | |
| 409 | <varlistentry> |
| 410 | <term><option>--encode</option> <replaceable>encoding</replaceable></term> |
| 411 | <listitem> |
| 412 | <simpara> |
| 413 | Output in the given encoding. |
| 414 | </simpara> |
| 415 | </listitem> |
| 416 | </varlistentry> |
| 417 | |
| 418 | <varlistentry> |
| 419 | <term><option>--catalogs</option></term> |
| 420 | <listitem> |
| 421 | <simpara> |
| 422 | Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog |
| 423 | is used by default. |
| 424 | </simpara> |
| 425 | </listitem> |
| 426 | </varlistentry> |
| 427 | |
| 428 | <varlistentry> |
| 429 | <term><option>--nocatalogs</option></term> |
| 430 | <listitem> |
| 431 | <simpara> |
| 432 | Do not use any catalogs. |
| 433 | </simpara> |
| 434 | </listitem> |
| 435 | </varlistentry> |
| 436 | |
| 437 | <varlistentry> |
| 438 | <term><option>--auto</option></term> |
| 439 | <listitem> |
| 440 | <simpara> |
| 441 | Generate a small document for testing purposes. |
| 442 | </simpara> |
| 443 | </listitem> |
| 444 | </varlistentry> |
| 445 | |
| 446 | <varlistentry> |
| 447 | <term><option>--xinclude</option></term> |
| 448 | <listitem> |
| 449 | <simpara> |
| 450 | Do XInclude processing. |
| 451 | </simpara> |
| 452 | </listitem> |
| 453 | </varlistentry> |
| 454 | <varlistentry> |
| 455 | <term><option>--loaddtd</option></term> |
| 456 | <listitem> |
| 457 | <simpara> |
| 458 | Fetch external DTD. |
| 459 | </simpara> |
| 460 | </listitem> |
| 461 | </varlistentry> |
| 462 | |
| 463 | <varlistentry> |
| 464 | <term><option>--dtdattr</option></term> |
| 465 | <listitem> |
| 466 | <simpara> |
| 467 | Fetch external DTD and populate the tree with inherited attributes. |
| 468 | </simpara> |
| 469 | </listitem> |
| 470 | </varlistentry> |
MST 2001 John Fleck | 2323ac2 | 2001-12-14 04:24:50 +0000 | [diff] [blame] | 471 | <varlistentry> |
| 472 | <term><option>--dropdtd</option></term> |
| 473 | <listitem> |
| 474 | <simpara> |
| 475 | Remove <acronym>DTD</acronym> from output. |
| 476 | </simpara> |
| 477 | </listitem> |
| 478 | </varlistentry> |
MST 2003 John Fleck | 7e54be1 | 2003-01-07 03:54:25 +0000 | [diff] [blame] | 479 | <varlistentry> |
| 480 | <term><option>--stream</option></term> |
| 481 | <listitem> |
MDT 2003 John Fleck | 83c8a5c | 2003-04-20 16:45:07 +0000 | [diff] [blame] | 482 | <simpara>Use streaming API - useful when used in combination with |
| 483 | --relaxng or --valid options for validation of files that are |
| 484 | too large to be held in memory.</simpara> |
MST 2003 John Fleck | 7e54be1 | 2003-01-07 03:54:25 +0000 | [diff] [blame] | 485 | </listitem> |
| 486 | </varlistentry> |
| 487 | <varlistentry> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 488 | <term><option>--walker</option></term> |
| 489 | <listitem> |
| 490 | <simpara>Test the walker module, which is a reader interface but for a |
| 491 | document tree, instead of using the reader API on an unparsed document it |
| 492 | works on a existing in-memory tree. Used in debugging.</simpara> |
| 493 | </listitem> |
| 494 | </varlistentry> |
| 495 | <varlistentry> |
MST 2003 John Fleck | 7e54be1 | 2003-01-07 03:54:25 +0000 | [diff] [blame] | 496 | <term><option>--chkregister</option></term> |
| 497 | <listitem> |
Daniel Veillard | da3b29a | 2004-08-14 11:15:13 +0000 | [diff] [blame] | 498 | <simpara>Turn on node registration. Useful for developers testing |
MST 2003 John Fleck | 7e54be1 | 2003-01-07 03:54:25 +0000 | [diff] [blame] | 499 | libxml2 node tracking code.</simpara> |
| 500 | </listitem> |
| 501 | </varlistentry> |
MST 2003 John Fleck | da27174 | 2003-03-25 14:05:17 +0000 | [diff] [blame] | 502 | <varlistentry> |
John Fleck | 3cbaa6d | 2004-08-15 00:47:45 +0000 | [diff] [blame] | 503 | <term><option>--pattern</option> <replaceable>patternvalue</replaceable></term> |
| 504 | <listitem> |
| 505 | <simpara>Used to exercise the pattern recognition engine, which can be |
| 506 | used with the reader interface to the parser. It allows to select some |
| 507 | nodes in the document based on an XPath (subset) expression. Used for |
| 508 | debugging.</simpara> |
| 509 | </listitem> |
| 510 | </varlistentry> |
| 511 | <varlistentry> |
MST 2003 John Fleck | da27174 | 2003-03-25 14:05:17 +0000 | [diff] [blame] | 512 | <term><option>--relaxng</option> <replaceable>schema</replaceable></term> |
| 513 | <listitem> |
| 514 | <simpara>Use RelaxNG file named <replaceable>schema</replaceable> for |
| 515 | validation.</simpara> |
| 516 | </listitem> |
| 517 | </varlistentry> |
Daniel Veillard | e8b09e4 | 2003-05-13 22:14:13 +0000 | [diff] [blame] | 518 | <varlistentry> |
| 519 | <term><option>--schema</option> <replaceable>schema</replaceable></term> |
| 520 | <listitem> |
| 521 | <simpara>Use a W3C XML Schema file named <replaceable>schema</replaceable> for validation.</simpara> |
| 522 | </listitem> |
| 523 | </varlistentry> |
| 524 | <varlistentry> |
MDT 2004 John Fleck | 774a3bd | 2004-08-15 00:54:21 +0000 | [diff] [blame^] | 525 | <term><option>--c14n</option></term> |
| 526 | <listitem> |
| 527 | <simpara>Output canonical XML.</simpara> |
| 528 | </listitem> |
| 529 | </varlistentry> |
| 530 | <varlistentry> |
Daniel Veillard | e8b09e4 | 2003-05-13 22:14:13 +0000 | [diff] [blame] | 531 | <term> |
| 532 | <option>--nonet</option></term> |
| 533 | <listitem> |
| 534 | <simpara>Do not use the Internet to fetch DTD's or entities.</simpara> |
| 535 | </listitem> |
| 536 | </varlistentry> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 537 | </variablelist> |
| 538 | </refsect1> |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 539 | |
| 540 | <refsect1 id="shell"> |
| 541 | <title>Shell</title> |
| 542 | <para> |
| 543 | <application>xmllint</application> offers an interactive shell mode |
| 544 | invoked with the <option>--shell</option> command. Available commands in |
| 545 | shell mode include: |
| 546 | </para> |
| 547 | <variablelist> |
| 548 | <varlistentry> |
| 549 | <term><option>base</option></term> |
| 550 | <listitem> |
| 551 | <simpara> |
| 552 | display XML base of the node |
| 553 | </simpara> |
| 554 | </listitem> |
| 555 | </varlistentry> |
| 556 | <varlistentry> |
| 557 | <term><option>bye</option></term> |
| 558 | <listitem> |
| 559 | <simpara> |
| 560 | leave shell |
| 561 | </simpara> |
| 562 | </listitem> |
| 563 | </varlistentry> |
| 564 | <varlistentry> |
| 565 | <term><option>cat <replaceable>node</replaceable></option></term> |
| 566 | <listitem> |
| 567 | <simpara> |
| 568 | Display node if given or current node. |
| 569 | </simpara> |
| 570 | </listitem> |
| 571 | </varlistentry> |
| 572 | <varlistentry> |
| 573 | <term><option>cd <replaceable>path</replaceable></option></term> |
| 574 | <listitem> |
| 575 | <simpara> |
| 576 | Change the current node to <replaceable>path</replaceable> (if given |
| 577 | and unique) or root if no argument given. |
| 578 | </simpara> |
| 579 | </listitem> |
| 580 | </varlistentry> |
| 581 | <varlistentry> |
| 582 | <term><option>dir <replaceable>path</replaceable></option></term> |
| 583 | <listitem> |
| 584 | <simpara> |
| 585 | Dumps information about the node (namespace, attributes, content). |
| 586 | </simpara> |
| 587 | </listitem> |
| 588 | </varlistentry> |
| 589 | <varlistentry> |
| 590 | <term><option>du <replaceable>path</replaceable></option></term> |
| 591 | <listitem> |
| 592 | <simpara> |
| 593 | Show the structure of the subtree under path or the current node. |
| 594 | </simpara> |
| 595 | </listitem> |
| 596 | </varlistentry> |
| 597 | <varlistentry> |
| 598 | <term><option>exit</option></term> |
| 599 | <listitem> |
| 600 | <simpara> |
| 601 | Leave the shell. |
| 602 | </simpara> |
| 603 | </listitem> |
| 604 | </varlistentry> |
| 605 | <varlistentry> |
| 606 | <term><option>help</option></term> |
| 607 | <listitem> |
| 608 | <simpara> |
| 609 | Show this help. |
| 610 | </simpara> |
| 611 | </listitem> |
| 612 | </varlistentry> |
| 613 | <varlistentry> |
| 614 | <term><option>free</option></term> |
| 615 | <listitem> |
| 616 | <simpara> |
| 617 | Display memory usage. |
| 618 | </simpara> |
| 619 | </listitem> |
| 620 | </varlistentry> |
| 621 | <varlistentry> |
| 622 | <term><option>load <replaceable>name</replaceable></option></term> |
| 623 | <listitem> |
| 624 | <simpara> |
| 625 | Load a new document with the given name. |
| 626 | </simpara> |
| 627 | </listitem> |
| 628 | </varlistentry> |
| 629 | <varlistentry> |
| 630 | <term><option>ls <replaceable>path</replaceable></option></term> |
| 631 | <listitem> |
| 632 | <simpara> |
| 633 | List contents of <replaceable>path</replaceable> (if given) or the |
| 634 | current directory. |
| 635 | </simpara> |
| 636 | </listitem> |
| 637 | </varlistentry> |
| 638 | <varlistentry> |
| 639 | <term><option>pwd</option></term> |
| 640 | <listitem> |
| 641 | <simpara> |
| 642 | Display the path to the current node. |
| 643 | </simpara> |
| 644 | </listitem> |
| 645 | </varlistentry> |
| 646 | <varlistentry> |
| 647 | <term><option>quit</option></term> |
| 648 | <listitem> |
| 649 | <simpara> |
| 650 | Leave the shell. |
| 651 | </simpara> |
| 652 | </listitem> |
| 653 | </varlistentry> |
| 654 | <varlistentry> |
| 655 | <term><option>save <replaceable>name</replaceable></option></term> |
| 656 | <listitem> |
| 657 | <simpara> |
| 658 | Saves the current document to <replaceable>name</replaceable> if |
| 659 | given or to the original name. |
| 660 | </simpara> |
| 661 | </listitem> |
| 662 | </varlistentry> |
| 663 | <varlistentry> |
| 664 | <term><option>validate</option></term> |
| 665 | <listitem> |
| 666 | <simpara> |
| 667 | Check the document for error. |
| 668 | </simpara> |
| 669 | </listitem> |
| 670 | </varlistentry> |
| 671 | <varlistentry> |
| 672 | <term><option>write <replaceable>name</replaceable></option></term> |
| 673 | <listitem> |
| 674 | <simpara> |
| 675 | Write the current node to the given filename. |
| 676 | </simpara> |
| 677 | </listitem> |
| 678 | </varlistentry> |
MST 2001 John Fleck | 2323ac2 | 2001-12-14 04:24:50 +0000 | [diff] [blame] | 679 | |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 680 | </variablelist> |
| 681 | </refsect1> |
MST 2004 John Fleck | e42ae6f | 2004-02-27 03:26:30 +0000 | [diff] [blame] | 682 | <refsect1> |
| 683 | <title>Catalogs</title> |
| 684 | <para>Catalog behavior can be changed by redirecting |
| 685 | queries to the user's own set of catalogs. This can be done by setting the |
| 686 | <varname>XML_CATALOG_FILES</varname> environment variable to a list of |
| 687 | catalogs. An empty one should deactivate loading the default |
| 688 | <filename>/etc/xml/catalog</filename> default catalog.</para> |
| 689 | </refsect1> |
MST 2002 John Fleck | 6647aed | 2002-12-26 02:23:24 +0000 | [diff] [blame] | 690 | <refsect1> |
| 691 | <title>Debugging Catalogs</title> |
| 692 | <para>Setting the environment variable <varname>XML_DEBUG_CATALOG</varname> |
| 693 | using the command <command>"export XML_DEBUG_CATALOG="</command> |
| 694 | outputs debugging information related to catalog operations.</para> |
| 695 | </refsect1> |
MDT 2004 John Fleck | 4c76c4f | 2004-06-20 00:36:06 +0000 | [diff] [blame] | 696 | <refsect1> |
| 697 | <title>Error Return Codes</title> |
| 698 | <para>On the completion of execution, <application>Xmllint</application> |
| 699 | returns the following error codes:</para> |
| 700 | <variablelist> |
| 701 | <varlistentry> |
| 702 | <term>0</term> |
| 703 | <listitem> |
| 704 | <simpara>No error</simpara> |
| 705 | </listitem> |
| 706 | </varlistentry> |
| 707 | <varlistentry> |
| 708 | <term>1</term> |
| 709 | <listitem> |
| 710 | <simpara>Unclassified</simpara> |
| 711 | </listitem> |
| 712 | </varlistentry> |
| 713 | <varlistentry> |
| 714 | <term>2</term> |
| 715 | <listitem> |
| 716 | <simpara>Error in DTD</simpara> |
| 717 | </listitem> |
| 718 | </varlistentry> |
| 719 | <varlistentry> |
| 720 | <term>3</term> |
| 721 | <listitem> |
| 722 | <simpara>Validation error</simpara> |
| 723 | </listitem> |
| 724 | </varlistentry> |
| 725 | <varlistentry> |
| 726 | <term>4</term> |
| 727 | <listitem> |
| 728 | <simpara>Validation error</simpara> |
| 729 | </listitem> |
| 730 | </varlistentry> |
| 731 | <varlistentry> |
| 732 | <term>5</term> |
| 733 | <listitem> |
| 734 | <simpara>Error in schema compilation</simpara> |
| 735 | </listitem> |
| 736 | </varlistentry> |
| 737 | <varlistentry> |
| 738 | <term>6</term> |
| 739 | <listitem> |
| 740 | <simpara>Error writing output</simpara> |
| 741 | </listitem> |
| 742 | </varlistentry> |
| 743 | <varlistentry> |
| 744 | <term>7</term> |
| 745 | <listitem> |
| 746 | <simpara>Error in pattern (generated when |
| 747 | <optional>--pattern</optional> option is used)</simpara> |
| 748 | </listitem> |
| 749 | </varlistentry> |
| 750 | <varlistentry> |
| 751 | <term>8</term> |
| 752 | <listitem> |
| 753 | <simpara>Error in Reader registration (generated when |
| 754 | <optional>--chkregister</optional> option is used)</simpara> |
| 755 | </listitem> |
| 756 | </varlistentry> |
| 757 | <varlistentry> |
| 758 | <term>9</term> |
| 759 | <listitem> |
| 760 | <simpara>Out of memory error</simpara> |
| 761 | </listitem> |
| 762 | </varlistentry> |
| 763 | </variablelist> |
| 764 | </refsect1> |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 765 | </refentry> |