MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" |
| 3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ |
| 4 | ]> |
| 5 | <refentry> |
| 6 | <refentryinfo> |
| 7 | <title>xmllint Manual</title> |
| 8 | <copyright> |
| 9 | <year>2001</year> |
| 10 | </copyright> |
| 11 | <author> |
| 12 | <firstname>John</firstname> |
| 13 | <surname>Fleck</surname> |
| 14 | </author> |
| 15 | <address><email>jfleck@inkstain.net</email></address> |
| 16 | <author> |
| 17 | <firstname>Ziying</firstname> |
| 18 | <surname>Sherwin</surname> |
| 19 | </author> |
| 20 | <address><email>sherwin@nlm.nih.gov</email></address> |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 21 | <author> |
| 22 | <firstname>Heiko</firstname> |
| 23 | <surname>Rupp</surname> |
| 24 | </author> |
| 25 | <address><email>hwr@pilhuhn.de</email></address> |
MST 2001 John Fleck | 3fc555e | 2001-12-11 04:41:24 +0000 | [diff] [blame] | 26 | |
| 27 | <releaseinfo>This is release 0.2 of the xmllint Manual.</releaseinfo> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 28 | </refentryinfo> |
| 29 | |
| 30 | <refmeta> |
| 31 | <refentrytitle>xmllint</refentrytitle> |
| 32 | <manvolnum>1</manvolnum> |
| 33 | </refmeta> |
| 34 | |
| 35 | <refnamediv> |
| 36 | <refname>xmllint</refname> |
| 37 | <refpurpose>command line <acronym>XML</acronym> tool</refpurpose> |
| 38 | </refnamediv> |
| 39 | |
| 40 | <refsynopsisdiv> |
| 41 | <cmdsynopsis> |
| 42 | <command>xmllint</command> |
| 43 | <group> |
| 44 | <arg>--version</arg> |
| 45 | <arg>--debug</arg> |
| 46 | <arg>--shell</arg> |
| 47 | <arg>--debugent</arg> |
| 48 | <arg>--copy</arg> |
| 49 | <arg>--recover</arg> |
| 50 | <arg>--noent</arg> |
| 51 | <arg>--noout</arg> |
| 52 | <arg>--htmlout</arg> |
| 53 | <arg>--nowrap</arg> |
| 54 | <arg>--valid</arg> |
| 55 | <arg>--postvalid</arg> |
| 56 | <arg>--dtdvalid <replaceable>URL</replaceable></arg> |
| 57 | <arg>--timing</arg> |
| 58 | <arg>--repeat</arg> |
| 59 | <arg>--insert</arg> |
| 60 | <arg>--compress</arg> |
John Fleck | 027edfb | 2001-11-04 20:13:58 +0000 | [diff] [blame] | 61 | <arg>--sgml</arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 62 | <arg>--html</arg> |
| 63 | <arg>--push</arg> |
| 64 | <arg>--memory</arg> |
| 65 | <arg>--nowarning</arg> |
| 66 | <arg>--noblanks</arg> |
| 67 | <arg>--format</arg> |
| 68 | <arg>--testIO</arg> |
| 69 | <arg>--encode <replaceable>encoding</replaceable></arg> |
| 70 | <arg>--catalogs</arg> |
| 71 | <arg>--nocatalogs</arg> |
| 72 | <arg>--auto</arg> |
| 73 | <arg>--xinclude</arg> |
| 74 | <arg>--loaddtd</arg> |
| 75 | <arg>--dtdattr</arg> |
MST 2001 John Fleck | 2323ac2 | 2001-12-14 04:24:50 +0000 | [diff] [blame] | 76 | <arg>--dropdtd</arg> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 77 | </group> |
| 78 | <arg><option><replaceable>xmlfile</replaceable></option></arg> |
| 79 | </cmdsynopsis> |
| 80 | </refsynopsisdiv> |
| 81 | |
| 82 | <refsect1 id="introduction"> |
| 83 | <title>Introduction</title> |
| 84 | <para> |
| 85 | The xmllint program parses one or more XML files, specified on the |
| 86 | command line as <replaceable>xmlfile</replaceable>. It prints various |
| 87 | types of output, depending upon the options selected. It is useful for |
| 88 | detecting errors both in <acronym>XML</acronym> code and in the |
| 89 | <acronym>XML</acronym> parser itself. |
| 90 | </para> |
| 91 | |
| 92 | <para> |
| 93 | It is included in <application>libxml2</application>. |
| 94 | </para> |
| 95 | </refsect1> |
| 96 | <refsect1 id="options"> |
| 97 | <title>Options</title> |
| 98 | <variablelist> |
| 99 | <varlistentry> |
| 100 | <term><option>--version</option></term> |
| 101 | <listitem> |
| 102 | <simpara> |
| 103 | Display the version of |
| 104 | <application>libxml2</application> used. |
| 105 | </simpara> |
| 106 | </listitem> |
| 107 | </varlistentry> |
| 108 | |
| 109 | <varlistentry> |
| 110 | <term><option>--debug</option></term> |
| 111 | <listitem> |
| 112 | <simpara> |
| 113 | Parse a file and output an annotated tree of the |
| 114 | in-memory version of the document. |
| 115 | </simpara> |
| 116 | </listitem> |
| 117 | </varlistentry> |
| 118 | |
| 119 | <varlistentry> |
| 120 | <term><option>--shell</option></term> |
| 121 | <listitem> |
| 122 | <simpara> |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 123 | Run a navigating shell. Details on available commands in shell mode |
| 124 | are below. |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 125 | </simpara> |
| 126 | </listitem> |
| 127 | </varlistentry> |
| 128 | |
| 129 | <varlistentry> |
| 130 | <term><option>--debugent</option></term> |
| 131 | <listitem> |
| 132 | <simpara> |
| 133 | Debug the entities defined in the document. |
| 134 | </simpara> |
| 135 | </listitem> |
| 136 | </varlistentry> |
| 137 | |
| 138 | <varlistentry> |
| 139 | <term><option>--copy</option> </term> |
| 140 | <listitem> |
| 141 | <simpara> |
| 142 | Test the internal copy implementation. |
| 143 | </simpara> |
| 144 | </listitem> |
| 145 | </varlistentry> |
| 146 | |
| 147 | |
| 148 | <varlistentry> |
| 149 | <term><option>--recover</option></term> |
| 150 | <listitem> |
| 151 | <simpara> |
| 152 | Output any parsable portions of an invalid |
| 153 | document. |
| 154 | </simpara> |
| 155 | </listitem> |
| 156 | </varlistentry> |
| 157 | |
| 158 | <varlistentry> |
| 159 | <term><option>--noent</option></term> |
| 160 | <listitem> |
| 161 | <simpara> |
| 162 | Substitute entity values for entity |
| 163 | references. By default, <application>xmllint</application> leaves entity |
| 164 | references in place. |
| 165 | </simpara> |
| 166 | </listitem> |
| 167 | </varlistentry> |
| 168 | |
| 169 | <varlistentry> |
| 170 | <term><option>--noout</option></term> |
| 171 | <listitem> |
| 172 | <simpara> |
| 173 | Suppress output. By default, |
| 174 | <application>xmllint</application> outputs the result tree. |
| 175 | </simpara> |
| 176 | </listitem> |
| 177 | </varlistentry> |
| 178 | |
| 179 | <varlistentry> |
| 180 | <term><option>--htmlout</option></term> |
| 181 | <listitem> |
| 182 | <simpara> |
| 183 | Output results as an <acronym>HTML</acronym> |
| 184 | file. This causes <application>xmllint</application> to output |
| 185 | the necessary <acronym>HTML</acronym> tags surrounding the result tree |
| 186 | output so the results can be displayed in a browser. |
| 187 | </simpara> |
| 188 | </listitem> |
| 189 | </varlistentry> |
| 190 | |
| 191 | <varlistentry> |
| 192 | <term><option>--nowrap </option></term> |
| 193 | <listitem> |
| 194 | <simpara> |
| 195 | Do not output HTML doc wrapper. |
| 196 | </simpara> |
| 197 | </listitem> |
| 198 | </varlistentry> |
| 199 | |
| 200 | <varlistentry> |
| 201 | <term><option>--valid </option></term> |
| 202 | <listitem> |
| 203 | <simpara> |
| 204 | Determine if the document is a valid instance |
| 205 | of the included Document Type Definition (<acronym>DTD</acronym>). A |
| 206 | <acronym>DTD</acronym> to be validated against also can be specified at |
| 207 | the command line using the <option>--dtdvalid</option> option. By default, |
| 208 | <application>xmllint</application> also checks to determine if the |
| 209 | document is well-formed. |
| 210 | </simpara> |
| 211 | </listitem> |
| 212 | </varlistentry> |
| 213 | |
| 214 | <varlistentry> |
| 215 | <term><option>--postvalid</option></term> |
| 216 | <listitem> |
| 217 | <simpara> |
| 218 | Validate after parsing is completed. |
| 219 | </simpara> |
| 220 | </listitem> |
| 221 | </varlistentry> |
| 222 | |
| 223 | <varlistentry> |
| 224 | <term> <option>--dtdvalid</option> <replaceable>URL</replaceable></term> |
| 225 | <listitem> |
| 226 | <simpara> |
| 227 | Use the |
| 228 | <acronym>DTD</acronym> specified by <replaceable>URL</replaceable> for |
| 229 | validation. |
| 230 | </simpara> |
| 231 | </listitem> |
| 232 | </varlistentry> |
| 233 | |
| 234 | <varlistentry> |
| 235 | <term><option>--timing</option></term> |
| 236 | <listitem> |
| 237 | <simpara> |
| 238 | Output information about the time it takes |
| 239 | <application>xmllint</application> to perform the various steps. |
| 240 | </simpara> |
| 241 | </listitem> |
| 242 | </varlistentry> |
| 243 | |
| 244 | <varlistentry> |
| 245 | <term><option>--repeat</option></term> |
| 246 | <listitem> |
| 247 | <simpara> |
| 248 | Repeat 100 times, for timing or profiling. |
| 249 | </simpara> |
| 250 | </listitem> |
| 251 | </varlistentry> |
| 252 | |
| 253 | <varlistentry> |
| 254 | <term><option>--insert</option></term> |
| 255 | <listitem> |
| 256 | <simpara> |
| 257 | Test for valid insertions. |
| 258 | </simpara> |
| 259 | </listitem> |
| 260 | </varlistentry> |
| 261 | |
| 262 | <varlistentry> |
| 263 | <term><option>--compress</option></term> |
| 264 | <listitem> |
| 265 | <simpara> |
| 266 | Turn on gzip compression of output. |
| 267 | </simpara> |
| 268 | </listitem> |
| 269 | </varlistentry> |
| 270 | |
John Fleck | 027edfb | 2001-11-04 20:13:58 +0000 | [diff] [blame] | 271 | <varlistentry> |
| 272 | <term><option>--sgml</option></term> |
| 273 | <listitem> |
| 274 | <simpara>Use the DocBook <acronym>SGML</acronym> parser. This allows |
| 275 | documents written in <acronym>SGML</acronym> DocBook to be converted |
| 276 | into an in-memory tree and treated as if they were written in |
| 277 | <acronym>XML</acronym>.</simpara> |
| 278 | </listitem> |
| 279 | </varlistentry> |
| 280 | |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 281 | <varlistentry> |
| 282 | <term><option>--html</option></term> |
| 283 | <listitem> |
| 284 | <simpara> |
| 285 | Use the <acronym>HTML</acronym> parser. |
| 286 | </simpara> |
| 287 | </listitem> |
| 288 | </varlistentry> |
| 289 | |
| 290 | <varlistentry> |
| 291 | <term><option>--push</option></term> |
| 292 | <listitem> |
| 293 | <simpara> |
| 294 | Use the push mode of the parser. |
| 295 | </simpara> |
| 296 | </listitem> |
| 297 | </varlistentry> |
| 298 | |
| 299 | |
| 300 | <varlistentry> |
| 301 | <term><option>--memory</option></term> |
| 302 | <listitem> |
| 303 | <simpara> |
| 304 | Parse from memory. |
| 305 | </simpara> |
| 306 | </listitem> |
| 307 | </varlistentry> |
| 308 | |
| 309 | <varlistentry> |
| 310 | <term><option>--nowarning</option></term> |
| 311 | <listitem> |
| 312 | <simpara> |
| 313 | Do not emit warnings from the parser and/or validator. |
| 314 | </simpara> |
| 315 | </listitem> |
| 316 | </varlistentry> |
| 317 | |
| 318 | <varlistentry> |
| 319 | <term><option>--noblanks</option></term> |
| 320 | <listitem> |
| 321 | <simpara> |
| 322 | Drop ignorable blank spaces. |
| 323 | </simpara> |
| 324 | </listitem> |
| 325 | </varlistentry> |
| 326 | |
| 327 | <varlistentry> |
| 328 | <term><option>--format</option></term> |
| 329 | <listitem> |
| 330 | <simpara> |
| 331 | Reformat and reindent the output. |
| 332 | </simpara> |
| 333 | </listitem> |
| 334 | </varlistentry> |
| 335 | |
| 336 | <varlistentry> |
| 337 | <term><option>--testIO</option></term> |
| 338 | <listitem> |
| 339 | <simpara> |
| 340 | Test user input/output support. |
| 341 | </simpara> |
| 342 | </listitem> |
| 343 | </varlistentry> |
| 344 | |
| 345 | <varlistentry> |
| 346 | <term><option>--encode</option> <replaceable>encoding</replaceable></term> |
| 347 | <listitem> |
| 348 | <simpara> |
| 349 | Output in the given encoding. |
| 350 | </simpara> |
| 351 | </listitem> |
| 352 | </varlistentry> |
| 353 | |
| 354 | <varlistentry> |
| 355 | <term><option>--catalogs</option></term> |
| 356 | <listitem> |
| 357 | <simpara> |
| 358 | Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog |
| 359 | is used by default. |
| 360 | </simpara> |
| 361 | </listitem> |
| 362 | </varlistentry> |
| 363 | |
| 364 | <varlistentry> |
| 365 | <term><option>--nocatalogs</option></term> |
| 366 | <listitem> |
| 367 | <simpara> |
| 368 | Do not use any catalogs. |
| 369 | </simpara> |
| 370 | </listitem> |
| 371 | </varlistentry> |
| 372 | |
| 373 | <varlistentry> |
| 374 | <term><option>--auto</option></term> |
| 375 | <listitem> |
| 376 | <simpara> |
| 377 | Generate a small document for testing purposes. |
| 378 | </simpara> |
| 379 | </listitem> |
| 380 | </varlistentry> |
| 381 | |
| 382 | <varlistentry> |
| 383 | <term><option>--xinclude</option></term> |
| 384 | <listitem> |
| 385 | <simpara> |
| 386 | Do XInclude processing. |
| 387 | </simpara> |
| 388 | </listitem> |
| 389 | </varlistentry> |
| 390 | <varlistentry> |
| 391 | <term><option>--loaddtd</option></term> |
| 392 | <listitem> |
| 393 | <simpara> |
| 394 | Fetch external DTD. |
| 395 | </simpara> |
| 396 | </listitem> |
| 397 | </varlistentry> |
| 398 | |
| 399 | <varlistentry> |
| 400 | <term><option>--dtdattr</option></term> |
| 401 | <listitem> |
| 402 | <simpara> |
| 403 | Fetch external DTD and populate the tree with inherited attributes. |
| 404 | </simpara> |
| 405 | </listitem> |
| 406 | </varlistentry> |
MST 2001 John Fleck | 2323ac2 | 2001-12-14 04:24:50 +0000 | [diff] [blame] | 407 | <varlistentry> |
| 408 | <term><option>--dropdtd</option></term> |
| 409 | <listitem> |
| 410 | <simpara> |
| 411 | Remove <acronym>DTD</acronym> from output. |
| 412 | </simpara> |
| 413 | </listitem> |
| 414 | </varlistentry> |
MDT 2001 John Fleck | fd32de6 | 2001-10-27 20:14:01 +0000 | [diff] [blame] | 415 | </variablelist> |
| 416 | </refsect1> |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 417 | |
| 418 | <refsect1 id="shell"> |
| 419 | <title>Shell</title> |
| 420 | <para> |
| 421 | <application>xmllint</application> offers an interactive shell mode |
| 422 | invoked with the <option>--shell</option> command. Available commands in |
| 423 | shell mode include: |
| 424 | </para> |
| 425 | <variablelist> |
| 426 | <varlistentry> |
| 427 | <term><option>base</option></term> |
| 428 | <listitem> |
| 429 | <simpara> |
| 430 | display XML base of the node |
| 431 | </simpara> |
| 432 | </listitem> |
| 433 | </varlistentry> |
| 434 | <varlistentry> |
| 435 | <term><option>bye</option></term> |
| 436 | <listitem> |
| 437 | <simpara> |
| 438 | leave shell |
| 439 | </simpara> |
| 440 | </listitem> |
| 441 | </varlistentry> |
| 442 | <varlistentry> |
| 443 | <term><option>cat <replaceable>node</replaceable></option></term> |
| 444 | <listitem> |
| 445 | <simpara> |
| 446 | Display node if given or current node. |
| 447 | </simpara> |
| 448 | </listitem> |
| 449 | </varlistentry> |
| 450 | <varlistentry> |
| 451 | <term><option>cd <replaceable>path</replaceable></option></term> |
| 452 | <listitem> |
| 453 | <simpara> |
| 454 | Change the current node to <replaceable>path</replaceable> (if given |
| 455 | and unique) or root if no argument given. |
| 456 | </simpara> |
| 457 | </listitem> |
| 458 | </varlistentry> |
| 459 | <varlistentry> |
| 460 | <term><option>dir <replaceable>path</replaceable></option></term> |
| 461 | <listitem> |
| 462 | <simpara> |
| 463 | Dumps information about the node (namespace, attributes, content). |
| 464 | </simpara> |
| 465 | </listitem> |
| 466 | </varlistentry> |
| 467 | <varlistentry> |
| 468 | <term><option>du <replaceable>path</replaceable></option></term> |
| 469 | <listitem> |
| 470 | <simpara> |
| 471 | Show the structure of the subtree under path or the current node. |
| 472 | </simpara> |
| 473 | </listitem> |
| 474 | </varlistentry> |
| 475 | <varlistentry> |
| 476 | <term><option>exit</option></term> |
| 477 | <listitem> |
| 478 | <simpara> |
| 479 | Leave the shell. |
| 480 | </simpara> |
| 481 | </listitem> |
| 482 | </varlistentry> |
| 483 | <varlistentry> |
| 484 | <term><option>help</option></term> |
| 485 | <listitem> |
| 486 | <simpara> |
| 487 | Show this help. |
| 488 | </simpara> |
| 489 | </listitem> |
| 490 | </varlistentry> |
| 491 | <varlistentry> |
| 492 | <term><option>free</option></term> |
| 493 | <listitem> |
| 494 | <simpara> |
| 495 | Display memory usage. |
| 496 | </simpara> |
| 497 | </listitem> |
| 498 | </varlistentry> |
| 499 | <varlistentry> |
| 500 | <term><option>load <replaceable>name</replaceable></option></term> |
| 501 | <listitem> |
| 502 | <simpara> |
| 503 | Load a new document with the given name. |
| 504 | </simpara> |
| 505 | </listitem> |
| 506 | </varlistentry> |
| 507 | <varlistentry> |
| 508 | <term><option>ls <replaceable>path</replaceable></option></term> |
| 509 | <listitem> |
| 510 | <simpara> |
| 511 | List contents of <replaceable>path</replaceable> (if given) or the |
| 512 | current directory. |
| 513 | </simpara> |
| 514 | </listitem> |
| 515 | </varlistentry> |
| 516 | <varlistentry> |
| 517 | <term><option>pwd</option></term> |
| 518 | <listitem> |
| 519 | <simpara> |
| 520 | Display the path to the current node. |
| 521 | </simpara> |
| 522 | </listitem> |
| 523 | </varlistentry> |
| 524 | <varlistentry> |
| 525 | <term><option>quit</option></term> |
| 526 | <listitem> |
| 527 | <simpara> |
| 528 | Leave the shell. |
| 529 | </simpara> |
| 530 | </listitem> |
| 531 | </varlistentry> |
| 532 | <varlistentry> |
| 533 | <term><option>save <replaceable>name</replaceable></option></term> |
| 534 | <listitem> |
| 535 | <simpara> |
| 536 | Saves the current document to <replaceable>name</replaceable> if |
| 537 | given or to the original name. |
| 538 | </simpara> |
| 539 | </listitem> |
| 540 | </varlistentry> |
| 541 | <varlistentry> |
| 542 | <term><option>validate</option></term> |
| 543 | <listitem> |
| 544 | <simpara> |
| 545 | Check the document for error. |
| 546 | </simpara> |
| 547 | </listitem> |
| 548 | </varlistentry> |
| 549 | <varlistentry> |
| 550 | <term><option>write <replaceable>name</replaceable></option></term> |
| 551 | <listitem> |
| 552 | <simpara> |
| 553 | Write the current node to the given filename. |
| 554 | </simpara> |
| 555 | </listitem> |
| 556 | </varlistentry> |
MST 2001 John Fleck | 2323ac2 | 2001-12-14 04:24:50 +0000 | [diff] [blame] | 557 | |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 558 | </variablelist> |
| 559 | </refsect1> |
MST 2002 John Fleck | 6647aed | 2002-12-26 02:23:24 +0000 | [diff] [blame] | 560 | <refsect1> |
| 561 | <title>Debugging Catalogs</title> |
| 562 | <para>Setting the environment variable <varname>XML_DEBUG_CATALOG</varname> |
| 563 | using the command <command>"export XML_DEBUG_CATALOG="</command> |
| 564 | outputs debugging information related to catalog operations.</para> |
| 565 | </refsect1> |
MST 2001 John Fleck | 4230404 | 2001-11-18 00:18:06 +0000 | [diff] [blame] | 566 | </refentry> |