suppressed warnings from within xmlValidGetValidElements (bug 144644)
* valid.c: suppressed warnings from within xmlValidGetValidElements
(bug 144644)
* doc/examples/testWriter.c: corrected typo in comment for ISO-8859-1
(bug 144245)
diff --git a/valid.c b/valid.c
index e78d7be..18a1fde 100644
--- a/valid.c
+++ b/valid.c
@@ -6586,6 +6586,14 @@
return(*len);
}
+/*
+ * Dummy function to suppress messages while we try out valid elements
+ */
+static void xmlNoValidityErr(void *ctx ATTRIBUTE_UNUSED,
+ const char *msg ATTRIBUTE_UNUSED, ...) {
+ return;
+}
+
/**
* xmlValidGetValidElements:
* @prev: an element to insert after
@@ -6631,14 +6639,15 @@
xmlElement *element_desc;
- memset(&vctxt, 0, sizeof (xmlValidCtxt));
-
if (prev == NULL && next == NULL)
return(-1);
if (names == NULL) return(-1);
if (max <= 0) return(-1);
+ memset(&vctxt, 0, sizeof (xmlValidCtxt));
+ vctxt.error = xmlNoValidityErr; /* this suppresses err/warn output */
+
nb_valid_elements = 0;
ref_node = prev ? prev : next;
parent = ref_node->parent;