Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4818 Serge 1
2
 
3
11
 
12
  
13
  Scott">
14
  Bronson">
15
  
16
  December  5, 2001">
17
  
19
  1">
20
  bronson@rinspin.com">
21
  
22
  XMLWF">
23
  
24
 
25
  Debian GNU/Linux">
26
  GNU">
27
]>
28
 
29
30
  
31
    
32
      &dhemail;
33
    
34
    
35
      &dhfirstname;
36
      &dhsurname;
37
    
38
    
39
      2001
40
      &dhusername;
41
    
42
    &dhdate;
43
  
44
  
45
    &dhucpackage;
46
 
47
    &dhsection;
48
  
49
  
50
    &dhpackage;
51
 
52
    Determines if an XML document is well-formed
53
  
54
  
55
    
56
      &dhpackage;
57
	  
58
	  
59
	  
60
	  
61
 
62
	  
63
	  
64
 
65
	  
66
	  
67
	  
68
 
69
	  
70
	  
71
 
72
	  
73
 
74
	  file ...
75
    
76
  
77
 
78
  
79
    DESCRIPTION
80
 
81
    
82
	&dhpackage; uses the Expat library to
83
	determine if an XML document is well-formed.  It is
84
	non-validating.
85
	
86
 
87
	
88
	If you do not specify any files on the command-line, and you
89
	have a recent version of &dhpackage;, the
90
	input file will be read from standard input.
91
	
92
 
93
  
94
 
95
  
96
    WELL-FORMED DOCUMENTS
97
 
98
	
99
	  A well-formed document must adhere to the
100
	  following rules:
101
	
102
 
103
	
104
      
105
	    The file begins with an XML declaration.  For instance,
106
		<?xml version="1.0" standalone="yes"?>.
107
		NOTE:
108
		&dhpackage; does not currently
109
		check for a valid XML declaration.
110
      
111
      
112
		Every start tag is either empty (<tag/>)
113
		or has a corresponding end tag.
114
      
115
      
116
	    There is exactly one root element.  This element must contain
117
		all other elements in the document.  Only comments, white
118
		space, and processing instructions may come after the close
119
		of the root element.
120
      
121
      
122
		All elements nest properly.
123
      
124
      
125
		All attribute values are enclosed in quotes (either single
126
		or double).
127
      
128
    
129
 
130
	
131
	  If the document has a DTD, and it strictly complies with that
132
	  DTD, then the document is also considered valid.
133
	  &dhpackage; is a non-validating parser --
134
	  it does not check the DTD.  However, it does support
135
	  external entities (see the  option).
136
	
137
  
138
 
139
  
140
    OPTIONS
141
 
142
143
When an option includes an argument, you may specify the argument either
144
separately (" output") or concatenated with the
145
option ("output").  &dhpackage;
146
supports both.
147
148
 
149
    
150
 
151
      
152
        
153
        
154
		
155
  If the input file is well-formed and &dhpackage;
156
  doesn't encounter any errors, the input file is simply copied to
157
  the output directory unchanged.
158
  This implies no namespaces (turns off ) and
159
  requires  to specify an output file.
160
  		
161
        
162
      
163
 
164
      
165
        
166
        
167
		
168
  Specifies a directory to contain transformed
169
  representations of the input files.
170
  By default,  outputs a canonical representation
171
  (described below).
172
  You can select different output formats using 
173
  and .
174
	  
175
	  
176
  The output filenames will
177
  be exactly the same as the input filenames or "STDIN" if the input is
178
  coming from standard input.  Therefore, you must be careful that the
179
  output file does not go into the same directory as the input
180
  file.  Otherwise, &dhpackage; will delete the
181
  input file before it generates the output file (just like running
182
  cat < file > file in most shells).
183
	  
184
	  
185
  Two structurally equivalent XML documents have a byte-for-byte
186
  identical canonical XML representation.
187
  Note that ignorable white space is considered significant and
188
  is treated equivalently to data.
189
  More on canonical XML can be found at
190
  http://www.jclark.com/xml/canonxml.html .
191
	  
192
        
193
      
194
 
195
      
196
        
197
        
198
		
199
   Specifies the character encoding for the document, overriding
200
   any document encoding declaration.  &dhpackage;
201
   supports four built-in encodings:
202
   	US-ASCII,
203
	UTF-8,
204
	UTF-16, and
205
	ISO-8859-1.
206
   Also see the  option.
207
	   
208
        
209
      
210
 
211
      
212
        
213
        
214
		
215
  Outputs some strange sort of XML file that completely
216
  describes the the input file, including character postitions.
217
  Requires  to specify an output file.
218
	   
219
        
220
      
221
 
222
      
223
        
224
        
225
		
226
  Turns on namespace processing.  (describe namespaces)
227
   disables namespaces.
228
	   
229
        
230
      
231
 
232
      
233
        
234
        
235
		
236
    Tells xmlwf to process external DTDs and parameter
237
    entities.
238
	 
239
	 
240
   Normally &dhpackage; never parses parameter
241
   entities.   tells it to always parse them.
242
    implies .
243
	   
244
        
245
      
246
 
247
      
248
        
249
        
250
		
251
   Normally &dhpackage; memory-maps the XML file
252
   before parsing; this can result in faster parsing on many
253
   platforms.
254
    turns off memory-mapping and uses normal file
255
   IO calls instead.
256
   Of course, memory-mapping is automatically turned off
257
   when reading from standard input.
258
	   
259
		
260
   Use of memory-mapping can cause some platforms to report
261
   substantially higher memory usage for
262
   &dhpackage;, but this appears to be a matter of
263
   the operating system reporting memory in a strange way; there is
264
   not a leak in &dhpackage;.
265
           
266
        
267
      
268
 
269
      
270
        
271
        
272
		
273
  Prints an error if the document is not standalone.
274
  A document is standalone if it has no external subset and no
275
  references to parameter entities.
276
	   
277
        
278
      
279
 
280
      
281
        
282
        
283
		
284
  Turns on timings.  This tells Expat to parse the entire file,
285
  but not perform any processing.
286
  This gives a fairly accurate idea of the raw speed of Expat itself
287
  without client overhead.
288
   turns off most of the output options
289
  (, , ,
290
  ...).
291
	   
292
        
293
      
294
 
295
      
296
        
297
        
298
		
299
  Prints the version of the Expat library being used, including some
300
  information on the compile-time configuration of the library, and
301
  then exits.
302
	   
303
        
304
      
305
 
306
      
307
        
308
        
309
		
310
  Enables support for Windows code pages.
311
  Normally, &dhpackage; will throw an error if it
312
  runs across an encoding that it is not equipped to handle itself.  With
313
  , &dhpackage; will try to use a Windows code
314
  page.  See also .
315
	   
316
        
317
      
318
 
319
      
320
        
321
        
322
		
323
  Turns on parsing external entities.
324
  
325
326
  Non-validating parsers are not required to resolve external
327
  entities, or even expand entities at all.
328
  Expat always expands internal entities (?),
329
  but external entity parsing must be enabled explicitly.
330
  
331
  
332
  External entities are simply entities that obtain their
333
  data from outside the XML file currently being parsed.
334
  
335
  
336
  This is an example of an internal entity:
337
338
<!ENTITY vers '1.0.2'>
339
340
  
341
  
342
  And here are some examples of external entities:
343
 
344
345
<!ENTITY header SYSTEM "header-&vers;.xml">  (parsed)
346
<!ENTITY logo SYSTEM "logo.png" PNG>         (unparsed)
347
348
 
349
	   
350
        
351
      
352
 
353
      
354
        
355
        
356
		
357
    (Two hyphens.)
358
    Terminates the list of options.  This is only needed if a filename
359
    starts with a hyphen.  For example:
360
	   
361
362
&dhpackage; -- -myfile.xml
363
364
		
365
    will run &dhpackage; on the file
366
    -myfile.xml.
367
	   
368
        
369
      
370
    
371
 
372
	
373
    Older versions of &dhpackage; do not support
374
    reading from standard input.
375
	
376
  
377
 
378
  
379
  OUTPUT
380
    
381
	If an input file is not well-formed,
382
	&dhpackage; prints a single line describing
383
	the problem to standard output.  If a file is well formed,
384
	&dhpackage; outputs nothing.
385
	Note that the result code is not set.
386
	
387
  
388
 
389
  
390
    BUGS
391
	
392
	&dhpackage; returns a 0 - noerr result,
393
	even if the file is not well-formed.  There is no good way for
394
	a program to use &dhpackage; to quickly
395
	check a file -- it must parse &dhpackage;'s
396
	standard output.
397
	
398
	
399
	The errors should go to standard error, not standard output.
400
	
401
	
402
	There should be a way to get  to send its
403
	output to standard output rather than forcing the user to send
404
	it to a file.
405
	
406
	
407
	I have no idea why anyone would want to use the
408
	, , and
409
	 options.  If someone could explain it to
410
	me, I'd like to add this information to this manpage.
411
	
412
  
413
 
414
  
415
    ALTERNATIVES
416
	
417
	  Here are some XML validators on the web:
418
 
419
420
http://www.hcrc.ed.ac.uk/~richard/xml-check.html
421
http://www.stg.brown.edu/service/xmlvalid/
422
http://www.scripting.com/frontier5/xml/code/xmlValidator.html
423
http://www.xml.com/pub/a/tools/ruwf/check.html
424
425
 
426
		 
427
  
428
 
429
  
430
    SEE ALSO
431
	
432
 
433
434
The Expat home page:        http://www.libexpat.org/
435
The W3 XML specification:   http://www.w3.org/TR/REC-xml
436
437
 
438
	
439
  
440
 
441
  
442
    AUTHOR
443
    
444
	  This manual page was written by &dhusername; &dhemail; for
445
      the &debian; system (but may be used by others).  Permission is
446
      granted to copy, distribute and/or modify this document under
447
      the terms of the GNU Free Documentation
448
      License, Version 1.1.
449
	
450
  
451
452
 
453