VirtualBox

source: vbox/trunk/src/libs/libxml2-2.9.4/doc/xmllint.1@ 72634

最後變更 在這個檔案從72634是 65950,由 vboxsync 提交於 8 年 前

libxml 2.9.4: fix export

  • 屬性 svn:eol-style 設為 native
檔案大小: 13.2 KB
 
1'\" t
2.\" Title: xmllint
3.\" Author: John Fleck <[email protected]>
4.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
5.\" Date: $Date$
6.\" Manual: xmllint Manual
7.\" Source: libxml2
8.\" Language: English
9.\"
10.TH "XMLLINT" "1" "$Date$" "libxml2" "xmllint Manual"
11.\" -----------------------------------------------------------------
12.\" * Define some portability stuff
13.\" -----------------------------------------------------------------
14.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15.\" http://bugs.debian.org/507673
16.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18.ie \n(.g .ds Aq \(aq
19.el .ds Aq '
20.\" -----------------------------------------------------------------
21.\" * set default formatting
22.\" -----------------------------------------------------------------
23.\" disable hyphenation
24.nh
25.\" disable justification (adjust text to left margin only)
26.ad l
27.\" -----------------------------------------------------------------
28.\" * MAIN CONTENT STARTS HERE *
29.\" -----------------------------------------------------------------
30.SH "NAME"
31xmllint \- command line XML tool
32.SH "SYNOPSIS"
33.HP \w'\fBxmllint\fR\ 'u
34\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-shell\fR | \fB\-\-xpath\ "\fR\fB\fIXPath_expression\fR\fR\fB"\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ "\fR\fB\fIPATH(S)\fR\fR\fB"\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fR\fB\fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fR\fB\fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fR\fB\fIFILE\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-maxmem\ \fR\fB\fINBBYTES\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fR\fB\fIENCODING\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fR\fB\fIPATTERNVALUE\fR\fR | \fB\-\-chkregister\fR | \fB\-\-relaxng\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schema\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-c14n\fR] {\fIXML\-FILE(S)\fR... | \-}
35.HP \w'\fBxmllint\fR\ 'u
36\fBxmllint\fR \fB\-\-help\fR
37.SH "DESCRIPTION"
38.PP
39The
40\fBxmllint\fR
41program parses one or more
42XML
43files, specified on the command line as
44\fIXML\-FILE\fR
45(or the standard input if the filename provided is
46\fB\-\fR
47)\&. It prints various types of output, depending upon the options selected\&. It is useful for detecting errors both in
48XML
49code and in the
50XML
51parser itself\&.
52.PP
53\fBxmllint\fR
54is included in
55\fBlibxml\fR(3)\&.
56.SH "OPTIONS"
57.PP
58\fBxmllint\fR
59accepts the following options (in alphabetical order):
60.PP
61\fB\-\-auto\fR
62.RS 4
63Generate a small document for testing purposes\&.
64.RE
65.PP
66\fB\-\-catalogs\fR
67.RS 4
68Use the
69SGML
70catalog(s) from
71\fBSGML_CATALOG_FILES\fR\&. Otherwise
72XML
73catalogs starting from
74/etc/xml/catalog
75are used by default\&.
76.RE
77.PP
78\fB\-\-chkregister\fR
79.RS 4
80Turn on node registration\&. Useful for developers testing
81\fBlibxml\fR(3)
82node tracking code\&.
83.RE
84.PP
85\fB\-\-compress\fR
86.RS 4
87Turn on
88\fBgzip\fR(1)
89compression of output\&.
90.RE
91.PP
92\fB\-\-copy\fR
93.RS 4
94Test the internal copy implementation\&.
95.RE
96.PP
97\fB\-\-c14n\fR
98.RS 4
99Use the W3C
100XML
101Canonicalisation (C14N) to serialize the result of parsing to
102stdout\&. It keeps comments in the result\&.
103.RE
104.PP
105\fB\-\-dtdvalid \fR\fB\fIURL\fR\fR
106.RS 4
107Use the
108DTD
109specified by an
110\fIURL\fR
111for validation\&.
112.RE
113.PP
114\fB\-\-dtdvalidfpi \fR\fB\fIFPI\fR\fR
115.RS 4
116Use the
117DTD
118specified by a Formal Public Identifier
119\fIFPI\fR
120for validation, note that this will require a catalog exporting that Formal Public Identifier to work\&.
121.RE
122.PP
123\fB\-\-debug\fR
124.RS 4
125Parse a file and output an annotated tree of the in\-memory version of the document\&.
126.RE
127.PP
128\fB\-\-debugent\fR
129.RS 4
130Debug the entities defined in the document\&.
131.RE
132.PP
133\fB\-\-dropdtd\fR
134.RS 4
135Remove
136DTD
137from output\&.
138.RE
139.PP
140\fB\-\-dtdattr\fR
141.RS 4
142Fetch external
143DTD
144and populate the tree with inherited attributes\&.
145.RE
146.PP
147\fB\-\-encode \fR\fB\fIENCODING\fR\fR
148.RS 4
149Output in the given encoding\&. Note that this works for full document not fragments or result from XPath queries\&.
150.RE
151.PP
152\fB\-\-format\fR
153.RS 4
154Reformat and reindent the output\&. The
155\fBXMLLINT_INDENT\fR
156environment variable controls the indentation\&. The default value is two spaces " ")\&.
157.RE
158.PP
159\fB\-\-help\fR
160.RS 4
161Print out a short usage summary for
162\fBxmllint\fR\&.
163.RE
164.PP
165\fB\-\-html\fR
166.RS 4
167Use the
168HTML
169parser\&.
170.RE
171.PP
172\fB\-\-htmlout\fR
173.RS 4
174Output results as an
175HTML
176file\&. This causes
177\fBxmllint\fR
178to output the necessary
179HTML
180tags surrounding the result tree output so the results can be displayed/viewed in a browser\&.
181.RE
182.PP
183\fB\-\-insert\fR
184.RS 4
185Test for valid insertions\&.
186.RE
187.PP
188\fB\-\-loaddtd\fR
189.RS 4
190Fetch an external
191DTD\&.
192.RE
193.PP
194\fB\-\-load\-trace\fR
195.RS 4
196Display all the documents loaded during the processing to
197stderr\&.
198.RE
199.PP
200\fB\-\-maxmem \fR\fB\fINNBYTES\fR\fR
201.RS 4
202Test the parser memory support\&.
203\fINNBYTES\fR
204is the maximum number of bytes the library is allowed to allocate\&. This can also be used to make sure batch processing of
205XML
206files will not exhaust the virtual memory of the server running them\&.
207.RE
208.PP
209\fB\-\-memory\fR
210.RS 4
211Parse from memory\&.
212.RE
213.PP
214\fB\-\-noblanks\fR
215.RS 4
216Drop ignorable blank spaces\&.
217.RE
218.PP
219\fB\-\-nocatalogs\fR
220.RS 4
221Do not use any catalogs\&.
222.RE
223.PP
224\fB\-\-nocdata\fR
225.RS 4
226Substitute CDATA section by equivalent text nodes\&.
227.RE
228.PP
229\fB\-\-noent\fR
230.RS 4
231Substitute entity values for entity references\&. By default,
232\fBxmllint\fR
233leaves entity references in place\&.
234.RE
235.PP
236\fB\-\-nonet\fR
237.RS 4
238Do not use the Internet to fetch
239DTDs or entities\&.
240.RE
241.PP
242\fB\-\-noout\fR
243.RS 4
244Suppress output\&. By default,
245\fBxmllint\fR
246outputs the result tree\&.
247.RE
248.PP
249\fB\-\-nowarning\fR
250.RS 4
251Do not emit warnings from the parser and/or validator\&.
252.RE
253.PP
254\fB\-\-nowrap\fR
255.RS 4
256Do not output
257HTML
258doc wrapper\&.
259.RE
260.PP
261\fB\-\-noxincludenode\fR
262.RS 4
263Do XInclude processing but do not generate XInclude start and end nodes\&.
264.RE
265.PP
266\fB\-\-nsclean\fR
267.RS 4
268Remove redundant namespace declarations\&.
269.RE
270.PP
271\fB\-\-output \fR\fB\fIFILE\fR\fR
272.RS 4
273Define a file path where
274\fBxmllint\fR
275will save the result of parsing\&. Usually the programs build a tree and save it on
276stdout, with this option the result
277XML
278instance will be saved onto a file\&.
279.RE
280.PP
281\fB\-\-path "\fR\fB\fIPATH(S)\fR\fR\fB"\fR
282.RS 4
283Use the (space\- or colon\-separated) list of filesystem paths specified by
284\fIPATHS\fR
285to load
286DTDs or entities\&. Enclose space\-separated lists by quotation marks\&.
287.RE
288.PP
289\fB\-\-pattern \fR\fB\fIPATTERNVALUE\fR\fR
290.RS 4
291Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser\&. It allows to select some nodes in the document based on an XPath (subset) expression\&. Used for debugging\&.
292.RE
293.PP
294\fB\-\-postvalid\fR
295.RS 4
296Validate after parsing has completed\&.
297.RE
298.PP
299\fB\-\-push\fR
300.RS 4
301Use the push mode of the parser\&.
302.RE
303.PP
304\fB\-\-recover\fR
305.RS 4
306Output any parsable portions of an invalid document\&.
307.RE
308.PP
309\fB\-\-relaxng \fR\fB\fISCHEMA\fR\fR
310.RS 4
311Use RelaxNG file named
312\fISCHEMA\fR
313for validation\&.
314.RE
315.PP
316\fB\-\-repeat\fR
317.RS 4
318Repeat 100 times, for timing or profiling\&.
319.RE
320.PP
321\fB\-\-schema \fR\fB\fISCHEMA\fR\fR
322.RS 4
323Use a W3C
324XML
325Schema file named
326\fISCHEMA\fR
327for validation\&.
328.RE
329.PP
330\fB\-\-shell\fR
331.RS 4
332Run a navigating shell\&. Details on available commands in shell mode are below (see
333the section called \(lqSHELL COMMANDS\(rq)\&.
334.RE
335.PP
336\fB\-\-xpath "\fR\fB\fIXPath_expression\fR\fR\fB"\fR
337.RS 4
338Run an XPath expression given as argument and print the result\&. In case of a nodeset result, each node in the node set is serialized in full in the output\&. In case of an empty node set the "XPath set is empty" result will be shown and an error exit code will be returned\&.
339.RE
340.PP
341\fB\-\-stream\fR
342.RS 4
343Use streaming
344API
345\- useful when used in combination with
346\fB\-\-relaxng\fR
347or
348\fB\-\-valid\fR
349options for validation of files that are too large to be held in memory\&.
350.RE
351.PP
352\fB\-\-testIO\fR
353.RS 4
354Test user input/output support\&.
355.RE
356.PP
357\fB\-\-timing\fR
358.RS 4
359Output information about the time it takes
360\fBxmllint\fR
361to perform the various steps\&.
362.RE
363.PP
364\fB\-\-valid\fR
365.RS 4
366Determine if the document is a valid instance of the included Document Type Definition (DTD)\&. A
367DTD
368to be validated against also can be specified at the command line using the
369\fB\-\-dtdvalid\fR
370option\&. By default,
371\fBxmllint\fR
372also checks to determine if the document is well\-formed\&.
373.RE
374.PP
375\fB\-\-version\fR
376.RS 4
377Display the version of
378\fBlibxml\fR(3)
379used\&.
380.RE
381.PP
382\fB\-\-walker\fR
383.RS 4
384Test the walker module, which is a reader interface but for a document tree, instead of using the reader
385API
386on an unparsed document it works on an existing in\-memory tree\&. Used for debugging\&.
387.RE
388.PP
389\fB\-\-xinclude\fR
390.RS 4
391Do XInclude processing\&.
392.RE
393.PP
394\fB\-\-xmlout\fR
395.RS 4
396Used in conjunction with
397\fB\-\-html\fR\&. Usually when
398HTML
399is parsed the document is saved with the
400HTML
401serializer\&. But with this option the resulting document is saved with the
402XML
403serializer\&. This is primarily used to generate
404XHTML
405from
406HTML
407input\&.
408.RE
409.SH "SHELL COMMANDS"
410.PP
411\fBxmllint\fR
412offers an interactive shell mode invoked with the
413\fB\-\-shell\fR
414command\&. Available commands in shell mode include (in alphabetical order):
415.PP
416\fBbase\fR
417.RS 4
418Display
419XML
420base of the node\&.
421.RE
422.PP
423\fBbye\fR
424.RS 4
425Leave the shell\&.
426.RE
427.PP
428\fBcat \fR\fB\fINODE\fR\fR
429.RS 4
430Display the given node or the current one\&.
431.RE
432.PP
433\fBcd \fR\fB\fIPATH\fR\fR
434.RS 4
435Change the current node to the given path (if unique) or root if no argument is given\&.
436.RE
437.PP
438\fBdir \fR\fB\fIPATH\fR\fR
439.RS 4
440Dumps information about the node (namespace, attributes, content)\&.
441.RE
442.PP
443\fBdu \fR\fB\fIPATH\fR\fR
444.RS 4
445Show the structure of the subtree under the given path or the current node\&.
446.RE
447.PP
448\fBexit\fR
449.RS 4
450Leave the shell\&.
451.RE
452.PP
453\fBhelp\fR
454.RS 4
455Show this help\&.
456.RE
457.PP
458\fBfree\fR
459.RS 4
460Display memory usage\&.
461.RE
462.PP
463\fBload \fR\fB\fIFILENAME\fR\fR
464.RS 4
465Load a new document with the given filename\&.
466.RE
467.PP
468\fBls \fR\fB\fIPATH\fR\fR
469.RS 4
470List contents of the given path or the current directory\&.
471.RE
472.PP
473\fBpwd\fR
474.RS 4
475Display the path to the current node\&.
476.RE
477.PP
478\fBquit\fR
479.RS 4
480Leave the shell\&.
481.RE
482.PP
483\fBsave \fR\fB\fIFILENAME\fR\fR
484.RS 4
485Save the current document to the given filename or to the original name\&.
486.RE
487.PP
488\fBvalidate\fR
489.RS 4
490Check the document for errors\&.
491.RE
492.PP
493\fBwrite \fR\fB\fIFILENAME\fR\fR
494.RS 4
495Write the current node to the given filename\&.
496.RE
497.SH "ENVIRONMENT"
498.PP
499\fBSGML_CATALOG_FILES\fR
500.RS 4
501SGML
502catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
503\fBSGML_CATALOG_FILES\fR
504environment variable to a list of catalogs\&. An empty one should deactivate loading the default
505/etc/sgml/catalog
506catalog\&.
507.RE
508.PP
509\fBXML_CATALOG_FILES\fR
510.RS 4
511XML
512catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
513\fBXML_CATALOG_FILES\fR
514environment variable to a list of catalogs\&. An empty one should deactivate loading the default
515/etc/xml/catalog
516catalog\&.
517.RE
518.PP
519\fBXML_DEBUG_CATALOG\fR
520.RS 4
521Setting the environment variable
522\fBXML_DEBUG_CATALOG\fR
523to
524\fInon\-zero\fR
525using the
526\fBexport\fR
527command outputs debugging information related to catalog operations\&.
528.RE
529.PP
530\fBXMLLINT_INDENT\fR
531.RS 4
532Setting the environment variable
533\fBXMLLINT_INDENT\fR
534controls the indentation\&. The default value is two spaces " "\&.
535.RE
536.SH "DIAGNOSTICS"
537.PP
538\fBxmllint\fR
539return codes provide information that can be used when calling it from scripts\&.
540.PP
541\fB0\fR
542.RS 4
543No error
544.RE
545.PP
546\fB1\fR
547.RS 4
548Unclassified
549.RE
550.PP
551\fB2\fR
552.RS 4
553Error in
554DTD
555.RE
556.PP
557\fB3\fR
558.RS 4
559Validation error
560.RE
561.PP
562\fB4\fR
563.RS 4
564Validation error
565.RE
566.PP
567\fB5\fR
568.RS 4
569Error in schema compilation
570.RE
571.PP
572\fB6\fR
573.RS 4
574Error writing output
575.RE
576.PP
577\fB7\fR
578.RS 4
579Error in pattern (generated when
580\fB\-\-pattern\fR
581option is used)
582.RE
583.PP
584\fB8\fR
585.RS 4
586Error in Reader registration (generated when
587\fB\-\-chkregister\fR
588option is used)
589.RE
590.PP
591\fB9\fR
592.RS 4
593Out of memory error
594.RE
595.SH "SEE ALSO"
596.PP
597\fBlibxml\fR(3)
598.PP
599More information can be found at
600.sp
601.RS 4
602.ie n \{\
603\h'-04'\(bu\h'+03'\c
604.\}
605.el \{\
606.sp -1
607.IP \(bu 2.3
608.\}
609\fBlibxml\fR(3)
610web page
611\m[blue]\fB\%http://www.xmlsoft.org/\fR\m[]
612.RE
613.sp
614.RS 4
615.ie n \{\
616\h'-04'\(bu\h'+03'\c
617.\}
618.el \{\
619.sp -1
620.IP \(bu 2.3
621.\}
622W3C
623XSLT
624page
625\m[blue]\fB\%http://www.w3.org/TR/xslt\fR\m[]
626.RE
627.sp
628.SH "AUTHORS"
629.PP
630\fBJohn Fleck\fR <\&jfleck@inkstain\&.net\&>
631.RS 4
632Author.
633.RE
634.PP
635\fBZiying Sherwin\fR <\&sherwin@nlm\&.nih\&.gov\&>
636.RS 4
637Author.
638.RE
639.PP
640\fBHeiko Rupp\fR <\&hwr@pilhuhn\&.de\&>
641.RS 4
642Author.
643.RE
644.SH "COPYRIGHT"
645.br
646Copyright \(co 2001, 2004
647.br
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette