more debug messages from Matthew Burgess xmlSchemaValidateLengthFacet API

* xmlschemas.c: more debug messages from Matthew Burgess
* xmlschemastypes.c: xmlSchemaValidateLengthFacet API missing check.
Daniel
diff --git a/ChangeLog b/ChangeLog
index cd1d140..01ca70f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Mar 16 22:53:53 CET 2005 Daniel Veillard <daniel@veillard.com>
+
+	* xmlschemas.c: more debug messages from Matthew Burgess
+	* xmlschemastypes.c: xmlSchemaValidateLengthFacet API missing check.
+
 Wed Mar 16 17:37:04 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
 
 	* xmlschemastypes.c: Aaaannnd putting back the previous changes done
diff --git a/xmlschemas.c b/xmlschemas.c
index 3835ada..586839d 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -1431,6 +1431,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);
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index b08012a..159ad2a 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -4688,6 +4688,8 @@
 			     xmlSchemaValPtr val,
 			     unsigned long *length)  
 {
+    if (type == NULL)
+        return(-1);
     return (xmlSchemaValidateLengthFacetInternal(facet,
 	type->builtInType, value, val, length,
 	XML_SCHEMA_WHITESPACE_UNKNOWN));