[xml] [Patch] Provide two more schema validation messages



Hi folks,

The attached trivial patch provides more specific validation messages for when a document contains values outside the bounds specified by a mininclusive or maxinclusive constraint. Compiled and regtested via 'make check' without any issues.

Regards,

Matt.
Common subdirectories: libxml2-2.6.18.orig/bakefile and libxml2-2.6.18/bakefile
Common subdirectories: libxml2-2.6.18.orig/doc and libxml2-2.6.18/doc
Common subdirectories: libxml2-2.6.18.orig/example and libxml2-2.6.18/example
Common subdirectories: libxml2-2.6.18.orig/include and libxml2-2.6.18/include
Common subdirectories: libxml2-2.6.18.orig/macos and libxml2-2.6.18/macos
Common subdirectories: libxml2-2.6.18.orig/python and libxml2-2.6.18/python
Common subdirectories: libxml2-2.6.18.orig/result and libxml2-2.6.18/result
Common subdirectories: libxml2-2.6.18.orig/test and libxml2-2.6.18/test
Common subdirectories: libxml2-2.6.18.orig/vms and libxml2-2.6.18/vms
Common subdirectories: libxml2-2.6.18.orig/win32 and libxml2-2.6.18/win32
diff -u libxml2-2.6.18.orig/xmlschemas.c libxml2-2.6.18/xmlschemas.c
--- libxml2-2.6.18.orig/xmlschemas.c    2005-03-12 18:51:47.000000000 +0000
+++ libxml2-2.6.18/xmlschemas.c 2005-03-16 21:10:01.000000000 +0000
@@ -1321,6 +1321,16 @@
                "by the pattern '%s'.\n");
            xmlSchemaVErr(ctxt, node, error, (const char *) msg, value, 
                facet->value);         
+       } else if (facetType == XML_SCHEMA_FACET_MININCLUSIVE) {
+           msg = xmlStrcat(msg, BAD_CAST "The value '%s' is less than the "
+               "minimum value allowed ('%s').\n");
+           xmlSchemaVErr(ctxt, node, error, (const char *) msg, value, 
+               facet->value);
+       } else if (facetType == XML_SCHEMA_FACET_MAXINCLUSIVE) {
+           msg = xmlStrcat(msg, BAD_CAST "The value '%s' is greater than the "
+               "maximum value allowed ('%s').\n");
+           xmlSchemaVErr(ctxt, node, error, (const char *) msg, value, 
+               facet->value);
        } else if (node->type == XML_ATTRIBUTE_NODE) {          
            msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not facet-valid.\n");
            xmlSchemaVErr(ctxt, node, error, (const char *) msg, value, NULL);
Common subdirectories: libxml2-2.6.18.orig/xstc and libxml2-2.6.18/xstc


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]