aboutsummaryrefslogtreecommitdiffstats
path: root/xmlcatalog.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-08-25 13:33:14 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-08-25 13:33:14 +0000
commit6c5f9d14cc2bdf602b57499d001626176e409d1b (patch)
treef9386530431a475352b3b0220f4bd30993b48d21 /xmlcatalog.c
parent7e8a4f7a3111916508f3c9c345d266f8549d9f78 (diff)
downloadandroid_external_libxml2-6c5f9d14cc2bdf602b57499d001626176e409d1b.tar.gz
android_external_libxml2-6c5f9d14cc2bdf602b57499d001626176e409d1b.tar.bz2
android_external_libxml2-6c5f9d14cc2bdf602b57499d001626176e409d1b.zip
added a --convert option to xmlcatalog to convert SGML ones to the XML
* include/libxml/catalog.h catalog.c xmlcatalog.c: added a --convert option to xmlcatalog to convert SGML ones to the XML syntax. * xmllint.c: small cleanup for $SGML_CATALOG_FILES support. Daniel
Diffstat (limited to 'xmlcatalog.c')
-rw-r--r--xmlcatalog.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/xmlcatalog.c b/xmlcatalog.c
index a66888d6..c2cd52fb 100644
--- a/xmlcatalog.c
+++ b/xmlcatalog.c
@@ -29,6 +29,7 @@ static int noout = 0;
static int create = 0;
static int add = 0;
static int del = 0;
+static int convert = 0;
static int verbose = 0;
static char *filename;
@@ -285,6 +286,8 @@ static void usage(const char *name) {
}
int main(int argc, char **argv) {
int i;
+ int ret;
+
if (argc <= 1) {
usage(argv[0]);
@@ -313,6 +316,9 @@ int main(int argc, char **argv) {
} else if ((!strcmp(argv[i], "-create")) ||
(!strcmp(argv[i], "--create"))) {
create++;
+ } else if ((!strcmp(argv[i], "-convert")) ||
+ (!strcmp(argv[i], "--convert"))) {
+ convert++;
} else if ((!strcmp(argv[i], "-add")) ||
(!strcmp(argv[i], "--add"))) {
i += 3;
@@ -340,17 +346,17 @@ int main(int argc, char **argv) {
} else if (argv[i][0] == '-')
continue;
filename = argv[i];
- if (!create) {
- xmlLoadCatalog(argv[i]);
- } else {
+ ret = xmlLoadCatalog(argv[i]);
+ if ((ret < 0) && (create)) {
xmlCatalogAdd(BAD_CAST "catalog", BAD_CAST argv[i], NULL);
}
break;
}
- if ((add) || (del)) {
- int ret;
+ if (convert)
+ ret = xmlCatalogConvert();
+ if ((add) || (del)) {
for (i = 1; i < argc ; i++) {
if (!strcmp(argv[i], "-"))
break;
@@ -404,7 +410,7 @@ int main(int argc, char **argv) {
}
}
}
- if ((add) || (del) || (create)) {
+ if ((add) || (del) || (create) || (convert)) {
if (noout) {
FILE *out;