xmllint.xml 25 KB

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