1 <!doctype refentry PUBLIC
"-//OASIS//DTD DocBook V4.1//EN" [
3 <!-- Process this file with docbook-to-man to generate an nroff manual
4 page: `docbook-to-man manpage.sgml > manpage.1'. You may view
5 the manual page with: `docbook-to-man manpage.sgml | nroff -man |
6 less'. A typical entry in a Makefile or Makefile.am is:
8 manpage.1: manpage.sgml
12 <!-- Fill in your name for FIRSTNAME and SURNAME. -->
13 <!ENTITY dhfirstname
"<firstname>Scott</firstname>">
14 <!ENTITY dhsurname
"<surname>Bronson</surname>">
15 <!-- Please adjust the date whenever revising the manpage. -->
16 <!ENTITY dhdate
"<date>December 5, 2001</date>">
17 <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
18 allowed: see man(7), man(1). -->
19 <!ENTITY dhsection
"<manvolnum>1</manvolnum>">
20 <!ENTITY dhemail
"<email>bronson@rinspin.com</email>">
21 <!ENTITY dhusername
"Scott Bronson">
22 <!ENTITY dhucpackage
"<refentrytitle>XMLWF</refentrytitle>">
23 <!ENTITY dhpackage
"xmlwf">
25 <!ENTITY debian
"<productname>Debian GNU/Linux</productname>">
26 <!ENTITY gnu
"<acronym>GNU</acronym>">
40 <holder>&dhusername;</holder>
50 <refname>&dhpackage;</refname>
52 <refpurpose>Determines if an XML document is well-formed
</refpurpose>
56 <command>&dhpackage;</command>
57 <arg><option>-s
</option></arg>
58 <arg><option>-n
</option></arg>
59 <arg><option>-p
</option></arg>
60 <arg><option>-x
</option></arg>
62 <arg><option>-e
<replaceable>encoding
</replaceable></option></arg>
63 <arg><option>-w
</option></arg>
65 <arg><option>-d
<replaceable>output-dir
</replaceable></option></arg>
66 <arg><option>-c
</option></arg>
67 <arg><option>-m
</option></arg>
69 <arg><option>-r
</option></arg>
70 <arg><option>-t
</option></arg>
72 <arg><option>-v
</option></arg>
79 <title>DESCRIPTION
</title>
82 <command>&dhpackage;</command> uses the Expat library to determine
83 if an XML document is well-formed. It is non-validating.
87 If you do not specify any files on the command-line,
88 and you have a recent version of
&dhpackage;, the input
89 file will be read from stdin.
95 <title>WELL-FORMED DOCUMENTS
</title>
98 A well-formed document must adhere to the
104 The file begins with an XML declaration. For instance,
105 <literal><?xml
version=
"1.0" standalone=
"yes"?
></literal>.
106 <emphasis>NOTE:
</emphasis> &dhpackage; does not currently
107 check for a valid XML declaration.
110 Every start tag is either empty (
<tag/
>)
111 or has a corresponding end tag.
114 There is exactly one root element. This element must contain
115 all other elements in the document. Only comments, white
116 space, and processing instructions may come after the close
120 All elements nest properly.
123 All attribute values are enclosed in quotes (either single
129 If the document has a DTD, and it strictly complies with that
130 DTD, then the document is also considered
<emphasis>valid
</emphasis>.
131 &dhpackage; is a non-validating parser -- it does not check the DTD.
132 However, it does support external entities (see the -x option).
137 <title>OPTIONS
</title>
140 When an option includes an argument, you may specify the argument either
141 separate (
"d output") or mashed (
"-doutput").
&dhpackage; supports both.
147 <term><option>-c
</option></term>
150 If the input file is well-formed and
&dhpackage; doesn't
151 encounter any errors, the input file is simply copied to
152 the output directory unchanged.
153 This implies no namespaces (turns off -n) and
154 requires -d to specify an output file.
160 <term><option>-d output-dir
</option></term>
163 Specifies a directory to contain transformed
164 representations of the input files.
165 By default, -d outputs a canonical representation
167 You can select different output formats using -c and -m.
170 The output filenames will
171 be exactly the same as the input filenames or
"STDIN" if the input is
172 coming from STDIN. Therefore, you must be careful that the
173 output file does not go into the same directory as the input
174 file. Otherwise,
&dhpackage; will delete the input file before
175 it generates the output file (just like running
176 <literal>cat
< file
> file
</literal> in most shells).
179 Two structurally equivalent XML documents have a byte-for-byte
180 identical canonical XML representation.
181 Note that ignorable white space is considered significant and
182 is treated equivalently to data.
183 More on canonical XML can be found at
184 http://www.jclark.com/xml/canonxml.html .
190 <term><option>-e encoding
</option></term>
193 Specifies the character encoding for the document, overriding
194 any document encoding declaration.
&dhpackage;
195 has four built-in encodings:
196 <literal>US-ASCII
</literal>,
197 <literal>UTF-
8</literal>,
198 <literal>UTF-
16</literal>, and
199 <literal>ISO-
8859-
1</literal>.
200 Also see the -w option.
206 <term><option>-m
</option></term>
209 Outputs some strange sort of XML file that completely
210 describes the the input file, including character postitions.
211 Requires -d to specify an output file.
217 <term><option>-n
</option></term>
220 Turns on namespace processing. (describe namespaces)
221 -c disables namespaces.
227 <term><option>-p
</option></term>
230 Tells xmlwf to process external DTDs and parameter
234 Normally
&dhpackage; never parses parameter entities.
235 -p tells it to always parse them.
242 <term><option>-r
</option></term>
245 Normally
&dhpackage; memory-maps the XML file before parsing.
246 -r turns off memory-mapping and uses normal file IO calls instead.
247 Of course, memory-mapping is automatically turned off
248 when reading from STDIN.
254 <term><option>-s
</option></term>
257 Prints an error if the document is not standalone.
258 A document is standalone if it has no external subset and no
259 references to parameter entities.
265 <term><option>-t
</option></term>
268 Turns on timings. This tells Expat to parse the entire file,
269 but not perform any processing.
270 This gives a fairly accurate idea of the raw speed of Expat itself
271 without client overhead.
272 -t turns off most of the output options (-d, -m -c, ...).
278 <term><option>-v
</option></term>
281 Prints the version of the Expat library being used, and then exits.
287 <term><option>-w
</option></term>
290 Enables Windows code pages.
291 Normally,
&dhpackage; will throw an error if it runs across
292 an encoding that it is not equipped to handle itself. With
293 -w,
&dhpackage; will try to use a Windows code page. See
300 <term><option>-x
</option></term>
303 Turns on parsing external entities.
306 Non-validating parsers are not required to resolve external
307 entities, or even expand entities at all.
308 Expat always expands internal entities (?),
309 but external entity parsing must be enabled explicitly.
312 External entities are simply entities that obtain their
313 data from outside the XML file currently being parsed.
316 This is an example of an internal entity:
318 <!ENTITY vers '
1.0.2'
>
322 And here are some examples of external entities:
325 <!ENTITY header SYSTEM
"header-&vers;.xml"> (parsed)
326 <!ENTITY logo SYSTEM
"logo.png" PNG
> (unparsed)
334 <term><option>--
</option></term>
337 For some reason,
&dhpackage; specifically ignores
"--"
338 anywhere it appears on the command line.
345 Older versions of
&dhpackage; do not support reading from STDIN.
350 <title>OUTPUT
</title>
352 If an input file is not well-formed,
&dhpackage; outputs
353 a single line describing the problem to STDOUT.
354 If a file is well formed,
&dhpackage; outputs nothing.
355 Note that the result code is
<emphasis>not
</emphasis> set.
362 According to the W3C standard, an XML file without a
363 declaration at the beginning is not considered well-formed.
364 However,
&dhpackage; allows this to pass.
367 &dhpackage; returns a
0 - noerr result, even if the file is
368 not well-formed. There is no good way for a program to use
369 xmlwf to quickly check a file -- it must parse xmlwf's STDOUT.
372 The errors should go to STDERR, not stdout.
375 There should be a way to get -d to send its output to STDOUT
376 rather than forcing the user to send it to a file.
379 I have no idea why anyone would want to use the -d, -c
380 and -m options. If someone could explain it to me, I'd
381 like to add this information to this manpage.
386 <title>ALTERNATIVES
</title>
388 Here are some XML validators on the web:
391 http://www.hcrc.ed.ac.uk/~richard/xml-check.html
392 http://www.stg.brown.edu/service/xmlvalid/
393 http://www.scripting.com/frontier5/xml/code/xmlValidator.html
394 http://www.xml.com/pub/a/tools/ruwf/check.html
395 (on a page with no less than
15 ads! Shame!)
402 <title>SEE ALSO
</title>
406 The Expat home page: http://www.libexpat.org/
407 The W3 XML specification: http://www.w3.org/TR/REC-xml
414 <title>AUTHOR
</title>
416 This manual page was written by
&dhusername; &dhemail; for
417 the
&debian; system (but may be used by others). Permission is
418 granted to copy, distribute and/or modify this document under
419 the terms of the
<acronym>GNU
</acronym> Free Documentation
420 License, Version
1.1.
425 <!-- Keep this comment at the end of the file
430 sgml-minimize-attributes:nil
431 sgml-always-quote-attributes:t
434 sgml-parent-document:nil
435 sgml-default-dtd-file:nil
436 sgml-exposed-tags:nil
437 sgml-local-catalogs:nil
438 sgml-local-ecat-files:nil