Lines Matching +full:document +full:- +full:file
1 <!--
10 Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
12 Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
18 this file is copyrighted under the GNU Free Documentation License 1.1.
19 -->
20 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
21 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
25 <!-- Please adjust this^^ date whenever cutting a new release. -->
59 <refpurpose>Determines if an XML document is well-formed</refpurpose>
65 <arg><replaceable>FILE</replaceable> ...</arg>
70 <arg><option>-h</option></arg>
71 <arg><option>--help</option></arg>
77 <arg><option>-v</option></arg>
78 <arg><option>--version</option></arg>
88 determine if an XML document is well-formed. It is
89 non-validating.
93 If you do not specify any files on the command-line, and you
95 input file will be read from standard input.
101 <title>WELL-FORMED DOCUMENTS</title>
104 A well-formed document must adhere to the
110 The file begins with an XML declaration. For instance,
122 all other elements in the document. Only comments, white
136 If the document has a DTD, and it strictly complies with that
137 DTD, then the document is also considered <emphasis>valid</emphasis>.
138 <command>&dhpackage;</command> is a non-validating parser --
140 external entities (see the <option>-x</option> option).
149 separately ("<option>-d</option> <replaceable>output</replaceable>") or concatenated with the
150 option ("<option>-d</option><replaceable>output</replaceable>"). <command>&dhpackage;</command>
157 <term><option>-a</option> <replaceable>factor</replaceable></term>
180 from the primary document in parsing,
189 If you ever need to increase this value for non-attack payload,
190 please file a bug report.
196 <term><option>-b</option> <replaceable>bytes</replaceable></term>
208 If you ever need to increase this value for non-attack payload,
209 please file a bug report.
215 <term><option>-c</option></term>
218 If the input file is well-formed and <command>&dhpackage;</command>
219 doesn't encounter any errors, the input file is simply copied to
221 This implies no namespaces (turns off <option>-n</option>) and
222 requires <option>-d</option> to specify an output directory.
228 <term><option>-d</option> <replaceable>output-dir</replaceable></term>
233 By default, <option>-d</option> outputs a canonical representation
235 You can select different output formats using <option>-c</option>,
236 <option>-m</option> and <option>-N</option>.
242 output file does not go into the same directory as the input
243 file. Otherwise, <command>&dhpackage;</command> will delete the
244 input file before it generates the output file (just like running
245 <literal>cat < file > file</literal> in most shells).
248 Two structurally equivalent XML documents have a byte-for-byte
259 <term><option>-e</option> <replaceable>encoding</replaceable></term>
262 Specifies the character encoding for the document, overriding
263 any document encoding declaration. <command>&dhpackage;</command>
264 supports four built-in encodings:
265 <literal>US-ASCII</literal>,
266 <literal>UTF-8</literal>,
267 <literal>UTF-16</literal>, and
268 <literal>ISO-8859-1</literal>.
269 Also see the <option>-w</option> option.
275 <term><option>-g</option> <replaceable>bytes</replaceable></term>
286 <term><option>-h</option></term>
287 <term><option>--help</option></term>
298 <term><option>-k</option></term>
302 by default halts after the the first file with an error.
313 <term><option>-m</option></term>
316 Outputs some strange sort of XML file that completely
317 describes the input file, including character positions.
318 Requires <option>-d</option> to specify an output file.
324 <term><option>-n</option></term>
328 <option>-c</option> disables namespaces.
334 <term><option>-N</option></term>
339 Requires <option>-d</option> to specify an output file.
345 <term><option>-p</option></term>
353 entities. <option>-p</option> tells it to always parse them.
354 <option>-p</option> implies <option>-x</option>.
360 <term><option>-q</option></term>
370 <term><option>-r</option></term>
373 Normally <command>&dhpackage;</command> memory-maps the XML file
376 <option>-r</option> turns off memory-mapping and uses normal file
378 Of course, memory-mapping is automatically turned off
382 Use of memory-mapping can cause some platforms to report
392 <term><option>-s</option></term>
395 Prints an error if the document is not standalone.
396 A document is standalone if it has no external subset and no
403 <term><option>-t</option></term>
406 Turns on timings. This tells Expat to parse the entire file,
410 <option>-t</option> turns off most of the output options
411 (<option>-d</option>, <option>-m</option>, <option>-c</option>, ...).
417 <term><option>-v</option></term>
418 <term><option>--version</option></term>
422 information on the compile-time configuration of the library, and
429 <term><option>-w</option></term>
435 <option>-w</option>, <command>&dhpackage;</command> will try to use a Windows code
436 page. See also <option>-e</option>.
442 <term><option>-x</option></term>
448 Non-validating parsers are not required to resolve external
455 data from outside the XML file currently being parsed.
467 <!ENTITY header SYSTEM "header-&vers;.xml"> (parsed)
476 <term><option>--</option></term>
484 &dhpackage; -- -myfile.xml
487 will run <command>&dhpackage;</command> on the file
488 <filename>-myfile.xml</filename>.
503 <command>&dhpackage;</command> outputs nothing for files which are problem-free.
504 If any input file is not well-formed, or if the output for any
505 input file cannot be opened, <command>&dhpackage;</command> prints a single
509 If the <option>-k</option> option is not provided, <command>&dhpackage;</command>
510 halts upon encountering a well-formedness or output-file error.
511 If <option>-k</option> is provided, <command>&dhpackage;</command> continues
518 <para>For options <option>-v</option>|<option>--version</option> or <option>-h</option>|<option>--help</option>, <command>&dhpackage;</command> always exits with status code 0. For other cases, the following exit status codes are returned:
522 <listitem><para>The input files are well-formed and the output (if requested) was written successfully.</para>
532 <listitem><para>One or more input files were not well-formed or could not be parsed.</para>
537 <listitem><para>If using the <option>-d</option> option, an error occurred opening an output file.</para>
542 <listitem><para>There was a command-line argument error in how <command>&dhpackage;</command> was invoked.</para>
556 There should be a way to get <option>-d</option> to send its
558 it to a file.
562 <option>-d</option>, <option>-c</option>, and
563 <option>-m</option> options. If someone could explain it to
574 The W3 XML 1.0 specification (fourth edition): https://www.w3.org/TR/2006/REC-xml-20060816/
587 granted to copy, distribute and/or modify this document under