2
//C- -------------------------------------------------------------------
3
//C- Xmltools for DjVu3 and DjVuLibre-3.5
4
//C- Copyright (c) 2002 Bill C. Riemers
5
//C- -------------------------------------------------------------------
6
//C- This software is subject to, and may be distributed under, the
7
//C- GNU General Public License, Version 2. The license should have
8
//C- accompanied the software or you may obtain a copy of the license
9
//C- from the Free Software Foundation at http://www.fsf.org .
11
//C- This program is distributed in the hope that it will be useful,
12
//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
//C- GNU General Public License for more details.
16
//C- I, Bill C. Riemers, hereby grant all rights to this code,
17
//C- provided usage complies with the GPL or a written exception to
18
//C- the GPL granted by any of Bill C. Riemers, Leon Bottou,
19
//C- Yann Le Cun, or the Free Source Foundation.
21
//C- ------------------------------------------------------------------
22
//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
23
//C- distributed by Lizardtech Software. On July 19th 2002, Lizardtech
24
//C- Software authorized us to replace the original DjVu(r) Reference
25
//C- Library notice by the following text (see doc/lizard2002.djvu):
27
//C- ------------------------------------------------------------------
28
//C- | DjVu (r) Reference Library (v. 3.5)
29
//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
30
//C- | The DjVu Reference Library is protected by U.S. Pat. No.
31
//C- | 6,058,214 and patents pending.
33
//C- | This software is subject to, and may be distributed under, the
34
//C- | GNU General Public License, Version 2. The license should have
35
//C- | accompanied the software or you may obtain a copy of the license
36
//C- | from the Free Software Foundation at http://www.fsf.org .
38
//C- | The computer code originally released by LizardTech under this
39
//C- | license and unmodified by other parties is deemed "the LIZARDTECH
40
//C- | ORIGINAL CODE." Subject to any third party intellectual property
41
//C- | claims, LizardTech grants recipient a worldwide, royalty-free,
42
//C- | non-exclusive license to make, use, sell, or otherwise dispose of
43
//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the
44
//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU
45
//C- | General Public License. This grant only confers the right to
46
//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to
47
//C- | the extent such infringement is reasonably necessary to enable
48
//C- | recipient to make, have made, practice, sell, or otherwise dispose
49
//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to
50
//C- | any greater extent that may be necessary to utilize further
51
//C- | modifications or combinations.
53
//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
54
//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
55
//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
56
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
57
//C- +------------------------------------------------------------------
59
// $Id: djvuxmlparser.cpp,v 1.7 2003/11/07 22:08:23 leonb Exp $
60
// $Name: release_3_5_14 $
66
# pragma implementation
69
#include "XMLParser.h"
73
#include "DjVuDocument.h"
74
#include "ByteStream.h"
75
#include "DjVuMessage.h"
82
main(int argc,char *argv[],char *[])
85
djvu_programname(argv[0]);
86
GArray<GUTF8String> dargv(0,argc-1);
87
for(int i=0;i<argc;++i)
88
dargv[i]=GNativeString(argv[i]);
91
bool is_valid=(argc >= 2);
92
if((is_valid=(argc>=2)))
96
if(! GURL::Filename::Native(argv[i]).is_file())
99
DjVuPrintErrorUTF8("Error: File '%s' does not exist.\n",argv[i]);
106
DjVuPrintErrorUTF8("Usage: %s <inputfiles>\n",argc?argv[0]:"-");
110
for(int i=1;i<argc;++i)
112
const GP<lt_XMLParser> parser(lt_XMLParser::create());
114
const GP<lt_XMLTags> tag(
115
lt_XMLTags::create(GURL::Filename::Native(dargv[i])));