1<?xml version="1.0"?> 2<?xml-stylesheet type="text/xsl" 3 href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?> 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 <!ENTITY xmllint "<command>xmllint</command>"> 8]> 9 10<refentry> 11 12<refentryinfo> 13 <title>xmllint Manual</title> 14 <productname>libxml2</productname> 15 <copyright> 16 <year>2001</year> 17 <year>2004</year> 18 </copyright> 19 <authorgroup> 20 <author> 21 <firstname>John</firstname> 22 <surname>Fleck</surname> 23 <affiliation> 24 <address> 25 <email>jfleck@inkstain.net</email> 26 </address> 27 </affiliation> 28 </author> 29 <author> 30 <firstname>Ziying</firstname> 31 <surname>Sherwin</surname> 32 <affiliation> 33 <address> 34 <email>sherwin@nlm.nih.gov</email> 35 </address> 36 </affiliation> 37 </author> 38 <author> 39 <firstname>Heiko</firstname> 40 <surname>Rupp</surname> 41 <affiliation> 42 <address> 43 <email>hwr@pilhuhn.de</email> 44 </address> 45 </affiliation> 46 </author> 47 </authorgroup> 48 <!-- still a bit buggy output, will talk to docbook-xsl upstream to fix this --> 49 <!-- <releaseinfo>This is release 0.5 of the xmllint Manual.</releaseinfo> --> 50 <!-- <edition>0.5</edition> --> 51</refentryinfo> 52 53<refmeta> 54 <refentrytitle>xmllint</refentrytitle> 55 <manvolnum>1</manvolnum> 56</refmeta> 57 58<refnamediv> 59 <refname>xmllint</refname> 60 <refpurpose>command line <acronym>XML</acronym> tool</refpurpose> 61</refnamediv> 62 63<refsynopsisdiv> 64 <cmdsynopsis> 65 <command>xmllint</command> 66 <group choice="opt"> 67 <arg choice="plain"><option>--version</option></arg> 68 <arg choice="plain"><option>--debug</option></arg> 69 <arg choice="plain"><option>--quiet</option></arg> 70 <arg choice="plain"><option>--shell</option></arg> 71 <arg choice="plain"><option>--xpath "<replaceable class="option">XPath_expression</replaceable>"</option></arg> 72 <arg choice="plain"><option>--debugent</option></arg> 73 <arg choice="plain"><option>--copy</option></arg> 74 <arg choice="plain"><option>--recover</option></arg> 75 <arg choice="plain"><option>--huge</option></arg> 76 <arg choice="plain"><option>--nocompact</option></arg> 77 <arg choice="plain"><option>--nodefdtd</option></arg> 78 <arg choice="plain"><option>--nodict</option></arg> 79 <arg choice="plain"><option>--noenc</option></arg> 80 <arg choice="plain"><option>--noent</option></arg> 81 <arg choice="plain"><option>--nofixup-base-uris</option></arg> 82 <arg choice="plain"><option>--noout</option></arg> 83 <arg choice="plain"><option>--nonet</option></arg> 84 <arg choice="plain"><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></arg> 85 <arg choice="plain"><option>--load-trace</option></arg> 86 <arg choice="plain"><option>--htmlout</option></arg> 87 <arg choice="plain"><option>--nowrap</option></arg> 88 <arg choice="plain"><option>--valid</option></arg> 89 <arg choice="plain"><option>--postvalid</option></arg> 90 <arg choice="plain"><option>--dtdvalid <replaceable class="option">URL</replaceable></option></arg> 91 <arg choice="plain"><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></arg> 92 <arg choice="plain"><option>--timing</option></arg> 93 <arg choice="plain"><option>--output <replaceable class="option">FILE</replaceable></option></arg> 94 <arg choice="plain"><option>--repeat</option></arg> 95 <arg choice="plain"><option>--insert</option></arg> 96 <arg choice="plain"><option>--compress</option></arg> 97 <arg choice="plain"><option>--html</option></arg> 98 <arg choice="plain"><option>--xmlout</option></arg> 99 <arg choice="plain"><option>--push</option></arg> 100 <arg choice="plain"><option>--memory</option></arg> 101 <arg choice="plain"><option>--max-ampl <replaceable class="option">INTEGER</replaceable></option></arg> 102 <arg choice="plain"><option>--maxmem <replaceable class="option">NBBYTES</replaceable></option></arg> 103 <arg choice="plain"><option>--nowarning</option></arg> 104 <arg choice="plain"><option>--noblanks</option></arg> 105 <arg choice="plain"><option>--nocdata</option></arg> 106 <arg choice="plain"><option>--format</option></arg> 107 <arg choice="plain"><option>--pretty <replaceable class="option">INTEGER</replaceable></option></arg> 108 <arg choice="plain"><option>--encode <replaceable class="option">ENCODING</replaceable></option></arg> 109 <arg choice="plain"><option>--dropdtd</option></arg> 110 <arg choice="plain"><option>--nsclean</option></arg> 111 <arg choice="plain"><option>--testIO</option></arg> 112 <arg choice="plain"><option>--catalogs</option></arg> 113 <arg choice="plain"><option>--nocatalogs</option></arg> 114 <arg choice="plain"><option>--auto</option></arg> 115 <arg choice="plain"><option>--xinclude</option></arg> 116 <arg choice="plain"><option>--noxincludenode</option></arg> 117 <arg choice="plain"><option>--loaddtd</option></arg> 118 <arg choice="plain"><option>--dtdattr</option></arg> 119 <arg choice="plain"><option>--stream</option></arg> 120 <arg choice="plain"><option>--walker</option></arg> 121 <arg choice="plain"><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></arg> 122 <arg choice="plain"><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></arg> 123 <arg choice="plain"><option>--schema <replaceable class="option">SCHEMA</replaceable></option></arg> 124 <arg choice="plain"><option>--schematron <replaceable class="option">SCHEMA</replaceable></option></arg> 125 <arg choice="plain"><option>--c14n</option></arg> 126 <arg choice="plain"><option>--c14n11</option></arg> 127 <arg choice="plain"><option>--exc-c14n</option></arg> 128 <arg choice="plain"><option>--pedantic</option></arg> 129 <arg choice="plain"><option>--sax</option></arg> 130 <arg choice="plain"><option>--sax1</option></arg> 131 <arg choice="plain"><option>--oldxml10</option></arg> 132 </group> 133 <group choice="req"> 134 <arg choice="plain" rep="repeat"><replaceable>XML-FILE(S)</replaceable></arg> 135 <arg choice="plain" rep="norepeat">-</arg> 136 </group> 137 </cmdsynopsis> 138</refsynopsisdiv> 139 140<refsect1 id="description"> 141 <title>DESCRIPTION</title> 142 <para> 143 The &xmllint; program parses one or more <acronym>XML</acronym> files, 144 specified on the command line as <replaceable>XML-FILE</replaceable> 145 (or the standard input if the filename provided 146 is <emphasis role="bold">-</emphasis> ). It prints various types of 147 output, depending upon the options selected. It is useful for detecting 148 errors both in <acronym>XML</acronym> code and in 149 the <acronym>XML</acronym> parser itself. 150 </para> 151 <para>&xmllint; is included in <citerefentry> 152 <refentrytitle>libxml</refentrytitle> 153 <manvolnum>3</manvolnum> 154 </citerefentry>.</para> 155</refsect1> 156 157<refsect1 id="options"> 158 <title>OPTIONS</title> 159 <para> 160 &xmllint; accepts the following options (in alphabetical order): 161 </para> 162 163 <variablelist> 164 165 <varlistentry> 166 <term><option>--auto</option></term> 167 <listitem> 168 <para>Generate a small document for testing purposes.</para> 169 </listitem> 170 </varlistentry> 171 172 <varlistentry> 173 <term><option>--catalogs</option></term> 174 <listitem> 175 <para> 176 Use the <acronym>SGML</acronym> catalog(s) from <envar>SGML_CATALOG_FILES</envar>. 177 Otherwise <acronym>XML</acronym> catalogs starting 178 from <filename>/etc/xml/catalog</filename> or, more specifically, 179 <filename>${sysconfdir}/xml/catalog</filename> are used by default. 180 </para> 181 </listitem> 182 </varlistentry> 183 184 <varlistentry> 185 <term><option>--compress</option></term> 186 <listitem> 187 <para> 188 Turn on <citerefentry> 189 <refentrytitle>gzip</refentrytitle> 190 <manvolnum>1</manvolnum> 191 </citerefentry> compression of output. 192 </para> 193 </listitem> 194 </varlistentry> 195 196 <varlistentry> 197 <term><option>--copy</option></term> 198 <listitem> 199 <para>Test the internal copy implementation.</para> 200 </listitem> 201 </varlistentry> 202 203 <varlistentry> 204 <term><option>--c14n</option></term> 205 <term><option>--c14n11</option></term> 206 <term><option>--exc-c14n</option></term> 207 <listitem> 208 <para> 209 Use the W3C <acronym>XML</acronym> Canonicalisation (<acronym>C14N</acronym>) to 210 serialize the result of parsing to <filename class="devicefile">stdout</filename>. 211 It keeps comments in the result. 212 </para> 213 </listitem> 214 </varlistentry> 215 216 <varlistentry> 217 <term><option>--dtdvalid <replaceable class="option">URL</replaceable></option></term> 218 <listitem> 219 <para> 220 Use the <acronym>DTD</acronym> specified by 221 an <replaceable>URL</replaceable> for validation. 222 </para> 223 </listitem> 224 </varlistentry> 225 226 <varlistentry> 227 <term><option>--dtdvalidfpi <replaceable class="option">FPI</replaceable></option></term> 228 <listitem> 229 <para> 230 Use the <acronym>DTD</acronym> specified by a Formal Public 231 Identifier <replaceable>FPI</replaceable> for validation, note that this 232 will require a catalog exporting that Formal Public Identifier to work. 233 </para> 234 </listitem> 235 </varlistentry> 236 237 <varlistentry> 238 <term><option>--debug</option></term> 239 <listitem> 240 <para> 241 Parse a file and output an annotated tree of the 242 in-memory version of the document. 243 </para> 244 </listitem> 245 </varlistentry> 246 247 <varlistentry> 248 <term><option>--debugent</option></term> 249 <listitem> 250 <para>Debug the entities defined in the document.</para> 251 </listitem> 252 </varlistentry> 253 254 <varlistentry> 255 <term><option>--dropdtd</option></term> 256 <listitem> 257 <para>Remove <acronym>DTD</acronym> from output.</para> 258 </listitem> 259 </varlistentry> 260 261 <varlistentry> 262 <term><option>--dtdattr</option></term> 263 <listitem> 264 <para> 265 Fetch external <acronym>DTD</acronym> and populate the tree with 266 inherited attributes. 267 </para> 268 </listitem> 269 </varlistentry> 270 271 <varlistentry> 272 <term><option>--encode <replaceable class="option">ENCODING</replaceable></option></term> 273 <listitem> 274 <para>Output in the given encoding. Note that this works for full document not fragments or result from XPath queries.</para> 275 </listitem> 276 </varlistentry> 277 278 <varlistentry> 279 <term><option>--format</option></term> 280 <listitem> 281 <para> 282 Reformat and reindent the output. The <envar>XMLLINT_INDENT</envar> 283 environment variable controls the indentation. The default value is two 284 spaces " "). 285 </para> 286 <para> 287 Especially in the absence of a DTD, this feature has never worked reliably 288 and is fundamentally broken. 289 </para> 290 </listitem> 291 </varlistentry> 292 293 <varlistentry> 294 <term><option>--html</option></term> 295 <listitem> 296 <para>Use the <acronym>HTML</acronym> parser.</para> 297 </listitem> 298 </varlistentry> 299 300 <varlistentry> 301 <term><option>--htmlout</option></term> 302 <listitem> 303 <para> 304 Output results as an <acronym>HTML</acronym> file. This 305 causes &xmllint; to output the necessary <acronym>HTML</acronym> 306 tags surrounding the result tree output so the results can be 307 displayed/viewed in a browser. 308 </para> 309 </listitem> 310 </varlistentry> 311 312 <varlistentry> 313 <term><option>--huge</option></term> 314 <listitem> 315 <para>Ignore some hardcoded parser limits.</para> 316 </listitem> 317 </varlistentry> 318 319 <varlistentry> 320 <term><option>--insert</option></term> 321 <listitem> 322 <para>Test for valid insertions.</para> 323 </listitem> 324 </varlistentry> 325 326 <varlistentry> 327 <term><option>--loaddtd</option></term> 328 <listitem> 329 <para>Fetch an external <acronym>DTD</acronym>.</para> 330 </listitem> 331 </varlistentry> 332 333 <varlistentry> 334 <term><option>--load-trace</option></term> 335 <listitem> 336 <para> 337 Display all the documents loaded during the processing 338 to <filename class="devicefile">stderr</filename>. 339 </para> 340 </listitem> 341 </varlistentry> 342 343 <varlistentry> 344 <term><option>--max-ampl <replaceable class="option">INTEGER</replaceable></option></term> 345 <listitem> 346 <para> 347 Set the maximum amplification factor which protects against 348 exponential entity expansion ("billion laughs"). The default value 349 is 5. Documents making heavy use of entity expansion may require a 350 higher value. 351 </para> 352 </listitem> 353 </varlistentry> 354 355 <varlistentry> 356 <term><option>--maxmem <replaceable class="option">NNBYTES</replaceable></option></term> 357 <listitem> 358 <para> 359 Test the parser memory support. <replaceable>NNBYTES</replaceable> 360 is the maximum number of bytes the library is allowed to allocate. 361 This can also be used to make sure batch processing 362 of <acronym>XML</acronym> files will not exhaust the virtual memory 363 of the server running them. 364 </para> 365 </listitem> 366 </varlistentry> 367 368 <varlistentry> 369 <term><option>--memory</option></term> 370 <listitem> 371 <para>Parse from memory.</para> 372 </listitem> 373 </varlistentry> 374 375 <varlistentry> 376 <term><option>--noblanks</option></term> 377 <listitem> 378 <para>Drop ignorable blank spaces.</para> 379 </listitem> 380 </varlistentry> 381 382 <varlistentry> 383 <term><option>--nocatalogs</option></term> 384 <listitem> 385 <para>Do not use any catalogs.</para> 386 </listitem> 387 </varlistentry> 388 389 <varlistentry> 390 <term><option>--nocdata</option></term> 391 <listitem> 392 <para>Substitute CDATA section by equivalent text nodes.</para> 393 </listitem> 394 </varlistentry> 395 396 <varlistentry> 397 <term><option>--nocompact</option></term> 398 <listitem> 399 <para> 400 Do not generate compact text nodes (parser option 401 XML_PARSE_COMPACT). Only for debugging. 402 </para> 403 </listitem> 404 </varlistentry> 405 406 <varlistentry> 407 <term><option>--nodefdtd</option></term> 408 <listitem> 409 <para> 410 Do not set default HTML doctype (parser option 411 HTML_PARSE_NODEFDTD). 412 </para> 413 </listitem> 414 </varlistentry> 415 416 <varlistentry> 417 <term><option>--nodict</option></term> 418 <listitem> 419 <para> 420 Don't use dictionaries (parser option XML_PARSE_NODICT). 421 Only for debugging. 422 </para> 423 </listitem> 424 </varlistentry> 425 426 <varlistentry> 427 <term><option>--noenc</option></term> 428 <listitem> 429 <para> 430 Ignore encoding declaration (parser option 431 XML_PARSE_IGNORE_ENC). 432 </para> 433 </listitem> 434 </varlistentry> 435 436 <varlistentry> 437 <term><option>--noent</option></term> 438 <listitem> 439 <para> 440 Substitute entity values for entity references. By default, &xmllint; 441 leaves entity references in place. 442 </para> 443 </listitem> 444 </varlistentry> 445 446 <varlistentry> 447 <term><option>--nofixup-base-uris</option></term> 448 <listitem> 449 <para> 450 Don't fix xml:base URIs when processing XIncludes 451 (parser option XML_PARSE_NOBASEFIX). 452 </para> 453 </listitem> 454 </varlistentry> 455 456 <varlistentry> 457 <term><option>--nonet</option></term> 458 <listitem> 459 <para> 460 Do not use the Internet to fetch <acronym>DTD</acronym>s or entities. 461 </para> 462 </listitem> 463 </varlistentry> 464 465 <varlistentry> 466 <term><option>--noout</option></term> 467 <listitem> 468 <para> 469 Suppress output. By default, &xmllint; outputs the result tree. 470 </para> 471 </listitem> 472 </varlistentry> 473 474 <varlistentry> 475 <term><option>--nowarning</option></term> 476 <listitem> 477 <para>Do not emit warnings from the parser and/or validator.</para> 478 </listitem> 479 </varlistentry> 480 481 <varlistentry> 482 <term><option>--nowrap</option></term> 483 <listitem> 484 <para>Do not output <acronym>HTML</acronym> doc wrapper.</para> 485 </listitem> 486 </varlistentry> 487 488 <varlistentry> 489 <term><option>--noxincludenode</option></term> 490 <listitem> 491 <para> 492 Do XInclude processing but do not generate XInclude start and end nodes. 493 </para> 494 </listitem> 495 </varlistentry> 496 497 <varlistentry> 498 <term><option>--nsclean</option></term> 499 <listitem> 500 <para>Remove redundant namespace declarations.</para> 501 </listitem> 502 </varlistentry> 503 504 <varlistentry> 505 <term><option>--oldxml10</option></term> 506 <listitem> 507 <para> 508 Use deprecated parsing rules before XML 1.0, 509 5th edition. 510 </para> 511 </listitem> 512 </varlistentry> 513 514 <varlistentry> 515 <term><option>--output <replaceable class="option">FILE</replaceable></option></term> 516 <listitem> 517 <para> 518 Define a file path where &xmllint; will save the result of parsing. 519 Usually the programs build a tree and save it 520 on <filename class="devicefile">stdout</filename>, with this option 521 the result <acronym>XML</acronym> instance will be saved onto a file. 522 </para> 523 </listitem> 524 </varlistentry> 525 526 <varlistentry> 527 <term><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></term> 528 <listitem> 529 <para> 530 Use the (space- or colon-separated) list of filesystem paths specified 531 by <replaceable>PATHS</replaceable> to load <acronym>DTD</acronym>s or 532 entities. Enclose space-separated lists by quotation marks. 533 </para> 534 </listitem> 535 </varlistentry> 536 537 <varlistentry> 538 <term><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></term> 539 <listitem> 540 <para> 541 Used to exercise the pattern recognition engine, which can be used 542 with the reader interface to the parser. It allows to select some 543 nodes in the document based on an XPath (subset) expression. Used 544 for debugging. 545 </para> 546 </listitem> 547 </varlistentry> 548 549 <varlistentry> 550 <term><option>--pedantic</option></term> 551 <listitem> 552 <para>Enable additional warnings.</para> 553 </listitem> 554 </varlistentry> 555 556 <varlistentry> 557 <term><option>--postvalid</option></term> 558 <listitem> 559 <para>Validate after parsing has completed.</para> 560 </listitem> 561 </varlistentry> 562 563 <varlistentry> 564 <term><option>--pretty <replaceable class="option">INTEGER</replaceable></option></term> 565 <listitem> 566 <para> 567 Value 0 means no formatting, 1 means XML_SAVE_FORMAT 568 (same as --format), 2 means XML_SAVE_WSNONSIG. 569 </para> 570 </listitem> 571 </varlistentry> 572 573 <varlistentry> 574 <term><option>--push</option></term> 575 <listitem> 576 <para>Use the push mode of the parser.</para> 577 </listitem> 578 </varlistentry> 579 580 <varlistentry> 581 <term><option>--quiet</option></term> 582 <listitem> 583 <para>Don't print informational messages to stderr.</para> 584 </listitem> 585 </varlistentry> 586 587 <varlistentry> 588 <term><option>--recover</option></term> 589 <listitem> 590 <para>Output any parsable portions of an invalid document.</para> 591 </listitem> 592 </varlistentry> 593 594 <varlistentry> 595 <term><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></term> 596 <listitem> 597 <para> 598 Use RelaxNG file named <replaceable class="option">SCHEMA</replaceable> 599 for validation. 600 </para> 601 </listitem> 602 </varlistentry> 603 604 <varlistentry> 605 <term><option>--repeat</option></term> 606 <listitem> 607 <para>Repeat 100 times, for timing or profiling.</para> 608 </listitem> 609 </varlistentry> 610 611 <varlistentry> 612 <term><option>--sax</option></term> 613 <listitem> 614 <para>Print SAX callbacks (only for debugging).</para> 615 </listitem> 616 </varlistentry> 617 618 <varlistentry> 619 <term><option>--sax1</option></term> 620 <listitem> 621 <para>Use deprecated SAX1 interface (only for debugging).</para> 622 </listitem> 623 </varlistentry> 624 625 <varlistentry> 626 <term><option>--schema <replaceable>SCHEMA</replaceable></option></term> 627 <listitem> 628 <para> 629 Use a W3C <acronym>XML</acronym> Schema file 630 named <replaceable>SCHEMA</replaceable> for validation. 631 </para> 632 </listitem> 633 </varlistentry> 634 635 <varlistentry> 636 <term><option>--schematron <replaceable>SCHEMA</replaceable></option></term> 637 <listitem> 638 <para> 639 Use a Schematron file 640 named <replaceable>SCHEMA</replaceable> for validation. 641 </para> 642 </listitem> 643 </varlistentry> 644 645 <varlistentry> 646 <term><option>--shell</option></term> 647 <listitem> 648 <para> 649 Run a navigating shell. Details on available commands in shell mode 650 are below (see <xref linkend="shell"/>). 651 </para> 652 </listitem> 653 </varlistentry> 654 655 <varlistentry> 656 <term><option>--xpath "<replaceable class="option">XPath_expression</replaceable>"</option></term> 657 <listitem> 658 <para> 659 Run an XPath expression given as argument and print the 660 result. In case of a nodeset result, each node in the 661 node set is serialized in full in the output. In case 662 of an empty node set the "XPath set is empty" result 663 will be shown and exit code 11 will be returned.. 664 This feature is EXPERIMENTAL. Implementation details can 665 change without futher notice. 666 </para> 667 </listitem> 668 </varlistentry> 669 670 <varlistentry> 671 <term><option>--stream</option></term> 672 <listitem> 673 <para> 674 Use streaming <acronym>API</acronym> - useful when used in combination 675 with <option>--relaxng</option> or <option>--valid</option> options 676 for validation of files that are too large to be held in memory. 677 </para> 678 </listitem> 679 </varlistentry> 680 681 <varlistentry> 682 <term><option>--testIO</option></term> 683 <listitem> 684 <para>Test user input/output support.</para> 685 </listitem> 686 </varlistentry> 687 688 <varlistentry> 689 <term><option>--timing</option></term> 690 <listitem> 691 <para> 692 Output information about the time it takes &xmllint; to perform the 693 various steps. 694 </para> 695 </listitem> 696 </varlistentry> 697 698 <varlistentry> 699 <term><option>--valid</option></term> 700 <listitem> 701 <para> 702 Determine if the document is a valid instance of the included 703 Document Type Definition (<acronym>DTD</acronym>). 704 A <acronym>DTD</acronym> to be validated against also can be 705 specified at the command line using the <option>--dtdvalid</option> 706 option. By default, &xmllint; also checks to determine if the 707 document is well-formed. 708 </para> 709 </listitem> 710 </varlistentry> 711 712 <varlistentry> 713 <term><option>--version</option></term> 714 <listitem> 715 <para> 716 Display the version of <citerefentry> 717 <refentrytitle>libxml</refentrytitle> 718 <manvolnum>3</manvolnum> 719 </citerefentry> used. 720 </para> 721 </listitem> 722 </varlistentry> 723 724 <varlistentry> 725 <term><option>--walker</option></term> 726 <listitem> 727 <para> 728 Test the walker module, which is a reader interface but for a 729 document tree, instead of using the reader <acronym>API</acronym> on 730 an unparsed document it works on an existing in-memory tree. Used for 731 debugging. 732 </para> 733 </listitem> 734 </varlistentry> 735 736 <varlistentry> 737 <term><option>--xinclude</option></term> 738 <listitem> 739 <para>Do XInclude processing.</para> 740 </listitem> 741 </varlistentry> 742 743 <varlistentry> 744 <term><option>--xmlout</option></term> 745 <listitem> 746 <para> 747 Used in conjunction with <option>--html</option>. Usually 748 when <acronym>HTML</acronym> is parsed the document is saved with 749 the <acronym>HTML</acronym> serializer. But with this option the 750 resulting document is saved with the <acronym>XML</acronym> 751 serializer. This is primarily used to 752 generate <acronym>XHTML</acronym> from <acronym>HTML</acronym> input. 753 </para> 754 </listitem> 755 </varlistentry> 756 757 </variablelist> 758</refsect1> 759 760<refsect1 id="shell"> 761 <title>SHELL COMMANDS</title> 762 <para> 763 &xmllint; offers an interactive shell mode invoked with 764 the <option>--shell</option> command. Available commands in shell mode 765 include (in alphabetical order): 766 </para> 767 <variablelist> 768 769 <varlistentry> 770 <term><command>base</command></term> 771 <listitem> 772 <para>Display <acronym>XML</acronym> base of the node.</para> 773 </listitem> 774 </varlistentry> 775 776 <varlistentry> 777 <term><command>bye</command></term> 778 <listitem> 779 <para>Leave the shell.</para> 780 </listitem> 781 </varlistentry> 782 783 <varlistentry> 784 <term><command>cat <replaceable>NODE</replaceable></command></term> 785 <listitem> 786 <para>Display the given node or the current one.</para> 787 </listitem> 788 </varlistentry> 789 790 <varlistentry> 791 <term><command>cd <replaceable>PATH</replaceable></command></term> 792 <listitem> 793 <para> 794 Change the current node to the given path (if unique) or root if no 795 argument is given. 796 </para> 797 </listitem> 798 </varlistentry> 799 800 <varlistentry> 801 <term><command>dir <replaceable>PATH</replaceable></command></term> 802 <listitem> 803 <para> 804 Dumps information about the node (namespace, attributes, content). 805 </para> 806 </listitem> 807 </varlistentry> 808 809 <varlistentry> 810 <term><command>du <replaceable>PATH</replaceable></command></term> 811 <listitem> 812 <para> 813 Show the structure of the subtree under the given path or the current node. 814 </para> 815 </listitem> 816 </varlistentry> 817 818 <varlistentry> 819 <term><command>exit</command></term> 820 <listitem> 821 <para>Leave the shell.</para> 822 </listitem> 823 </varlistentry> 824 825 <varlistentry> 826 <term><command>help</command></term> 827 <listitem> 828 <para>Show this help.</para> 829 </listitem> 830 </varlistentry> 831 832 <varlistentry> 833 <term><command>load <replaceable>FILENAME</replaceable></command></term> 834 <listitem> 835 <para>Load a new document with the given filename.</para> 836 </listitem> 837 </varlistentry> 838 839 <varlistentry> 840 <term><command>ls <replaceable>PATH</replaceable></command></term> 841 <listitem> 842 <para>List contents of the given path or the current directory.</para> 843 </listitem> 844 </varlistentry> 845 846 <varlistentry> 847 <term><command>pwd</command></term> 848 <listitem> 849 <para>Display the path to the current node.</para> 850 </listitem> 851 </varlistentry> 852 853 <varlistentry> 854 <term><command>quit</command></term> 855 <listitem> 856 <para>Leave the shell.</para> 857 </listitem> 858 </varlistentry> 859 860 <varlistentry> 861 <term><command>save <replaceable>FILENAME</replaceable></command></term> 862 <listitem> 863 <para> 864 Save the current document to the given filename or to the original name. 865 </para> 866 </listitem> 867 </varlistentry> 868 869 <varlistentry> 870 <term><option>validate</option></term> 871 <listitem> 872 <para>Check the document for errors.</para> 873 </listitem> 874 </varlistentry> 875 876 <varlistentry> 877 <term><command>write <replaceable>FILENAME</replaceable></command></term> 878 <listitem> 879 <para>Write the current node to the given filename.</para> 880 </listitem> 881 </varlistentry> 882 883 </variablelist> 884</refsect1> 885 886<refsect1 id="environment"> 887 <title>ENVIRONMENT</title> 888 <variablelist> 889 890 <varlistentry> 891 <term><envar>SGML_CATALOG_FILES</envar></term> 892 <listitem> 893 <para><acronym>SGML</acronym> catalog behavior can be changed by redirecting 894 queries to the user's own set of catalogs. This can be done by setting 895 the <envar>SGML_CATALOG_FILES</envar> environment variable to a list 896 of catalogs. An empty one should deactivate loading the 897 default catalog. 898 </para> 899 </listitem> 900 </varlistentry> 901 902 <varlistentry> 903 <term><envar>XML_CATALOG_FILES</envar></term> 904 <listitem> 905 <para><acronym>XML</acronym> catalog behavior can be changed by redirecting 906 queries to the user's own set of catalogs. This can be done by setting 907 the <envar>XML_CATALOG_FILES</envar> environment variable to a space-separated 908 list of catalogs. Use percent-encoding to escape spaces or other characters. 909 An empty variable should deactivate loading the default catalog. 910 </para> 911 </listitem> 912 </varlistentry> 913 914 <varlistentry> 915 <term><envar>XML_DEBUG_CATALOG</envar></term> 916 <listitem> 917 <para>Setting the environment variable <envar>XML_DEBUG_CATALOG</envar> 918 to <parameter>non-zero</parameter> using the <command>export</command> 919 command outputs debugging information related to catalog operations. 920 </para> 921 </listitem> 922 </varlistentry> 923 924 <varlistentry> 925 <term><envar>XMLLINT_INDENT</envar></term> 926 <listitem> 927 <para>Setting the environment variable <envar>XMLLINT_INDENT</envar> 928 controls the indentation. The default value is two spaces " ". 929 </para> 930 </listitem> 931 </varlistentry> 932 933 </variablelist> 934</refsect1> 935 936<refsect1 id="diagnostics"> 937 <title>DIAGNOSTICS</title> 938 <para> 939 &xmllint; return codes provide information that can be used when 940 calling it from scripts. 941 </para> 942 <!-- better use segmentedlist element later, 943 which is currently only supported in snapshots --> 944 <variablelist> 945 946 <varlistentry> 947 <term><errorcode>0</errorcode></term> 948 <listitem> 949 <para>No error</para> 950 </listitem> 951 </varlistentry> 952 953 <varlistentry> 954 <term><errorcode>1</errorcode></term> 955 <listitem> 956 <para>Unclassified</para> 957 </listitem> 958 </varlistentry> 959 960 <varlistentry> 961 <term><errorcode>2</errorcode></term> 962 <listitem> 963 <para>Error in <acronym>DTD</acronym></para> 964 </listitem> 965 </varlistentry> 966 967 <varlistentry> 968 <term><errorcode>3</errorcode></term> 969 <listitem> 970 <para>Validation error</para> 971 </listitem> 972 </varlistentry> 973 974 <varlistentry> 975 <term><errorcode>4</errorcode></term> 976 <listitem> 977 <para>Validation error</para> 978 </listitem> 979 </varlistentry> 980 981 <varlistentry> 982 <term><errorcode>5</errorcode></term> 983 <listitem> 984 <para>Error in schema compilation</para> 985 </listitem> 986 </varlistentry> 987 988 <varlistentry> 989 <term><errorcode>6</errorcode></term> 990 <listitem> 991 <para>Error writing output</para> 992 </listitem> 993 </varlistentry> 994 995 <varlistentry> 996 <term><errorcode>7</errorcode></term> 997 <listitem> 998 <para> 999 Error in pattern (generated when <option>--pattern</option> option is used) 1000 </para> 1001 </listitem> 1002 </varlistentry> 1003 1004 <varlistentry> 1005 <term><errorcode>9</errorcode></term> 1006 <listitem> 1007 <para>Out of memory error</para> 1008 </listitem> 1009 </varlistentry> 1010 1011 <varlistentry> 1012 <term><errorcode>10</errorcode></term> 1013 <listitem> 1014 <para>XPath evaluation error</para> 1015 </listitem> 1016 </varlistentry> 1017 1018 <varlistentry> 1019 <term><errorcode>11</errorcode></term> 1020 <listitem> 1021 <para>XPath result is empty</para> 1022 </listitem> 1023 </varlistentry> 1024 1025 </variablelist> 1026</refsect1> 1027 1028<refsect1 id="seealso"> 1029 <title>SEE ALSO</title> 1030 <para><citerefentry> 1031 <refentrytitle>libxml</refentrytitle> 1032 <manvolnum>3</manvolnum> 1033 </citerefentry> 1034 </para> 1035 <para> 1036 More information can be found at 1037 <itemizedlist> 1038 <listitem> 1039 <para><citerefentry> 1040 <refentrytitle>libxml</refentrytitle> 1041 <manvolnum>3</manvolnum> 1042 </citerefentry> web page <ulink url="https://gitlab.gnome.org/GNOME/libxml2"/> 1043 </para> 1044 </listitem> 1045 </itemizedlist> 1046 </para> 1047</refsect1> 1048 1049</refentry> 1050