aboutsummaryrefslogtreecommitdiffstats
path: root/xmllint.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-08-22 00:06:49 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-08-22 00:06:49 +0000
commite2940ddb351e0aa2055ec6b74c245685196d532b (patch)
tree00d08550a570bc97b7c70fcd8e681588cacdb559 /xmllint.c
parent6433954692abb5620ed4e554a2979ef4ecdc6871 (diff)
downloadandroid_external_libxml2-e2940ddb351e0aa2055ec6b74c245685196d532b.tar.gz
android_external_libxml2-e2940ddb351e0aa2055ec6b74c245685196d532b.tar.bz2
android_external_libxml2-e2940ddb351e0aa2055ec6b74c245685196d532b.zip
starts to look okay, really plugged the new framework, cleaned a lot of
* catalog.c parser.c xmlIO.c xmlcatalog.c xmllint.c include/libxml/catalog.h: starts to look okay, really plugged the new framework, cleaned a lot of stuff, added some APIs, except the PI's support missing this should be mostly complete * result/catalogs/* test/catalogs/*: added new test, enriched the existing one with URN ID tests Daniel
Diffstat (limited to 'xmllint.c')
-rw-r--r--xmllint.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/xmllint.c b/xmllint.c
index ba3c48ec..c04776ea 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -104,6 +104,10 @@ static int progresult = 0;
static int timing = 0;
static int generate = 0;
static struct timeval begin, end;
+#ifdef LIBXML_CATALOG_ENABLED
+static int catalogs = 0;
+static int nocatalogs = 0;
+#endif
/************************************************************************
* *
@@ -798,6 +802,8 @@ static void usage(const char *name) {
printf("\t--encode encoding : output in the given encoding\n");
#ifdef LIBXML_CATALOG_ENABLED
printf("\t--catalogs : use the catalogs from $SGML_CATALOG_FILES\n");
+ printf("\t otherwise /etc/xml/catalog is activated by default\n");
+ printf("\t--nocatalogs: desactivate all catalogs\n");
#endif
printf("\t--auto : generate a small doc on the fly\n");
#ifdef LIBXML_XINCLUDE_ENABLED
@@ -931,14 +937,10 @@ main(int argc, char **argv) {
#ifdef LIBXML_CATALOG_ENABLED
else if ((!strcmp(argv[i], "-catalogs")) ||
(!strcmp(argv[i], "--catalogs"))) {
- const char *catalogs;
-
- catalogs = getenv("SGML_CATALOG_FILES");
- if (catalogs == NULL) {
- fprintf(stderr, "Variable $SGML_CATALOG_FILES not set\n");
- } else {
- xmlLoadCatalogs(catalogs);
- }
+ catalogs++;
+ } else if ((!strcmp(argv[i], "-nocatalogs")) ||
+ (!strcmp(argv[i], "--nocatalogs"))) {
+ nocatalogs++;
}
#endif
else if ((!strcmp(argv[i], "-encode")) ||
@@ -966,6 +968,17 @@ main(int argc, char **argv) {
return(1);
}
}
+
+#ifdef LIBXML_CATALOG_ENABLED
+ if (nocatalogs == 0) {
+ if (catalogs) {
+ const char *catal;
+
+ catal = getenv("SGML_CATALOG_FILES");
+ xmlLoadCatalogs(catal);
+ }
+ }
+#endif
xmlLineNumbersDefault(1);
if (loaddtd != 0)
xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;