more types, more coverage more problems fixed Daniel

* gentest.py testapi.c: more types, more coverage
* parser.c parserInternals.c relaxng.c valid.c xmlIO.c
  xmlschemastypes.c: more problems fixed
Daniel
diff --git a/parserInternals.c b/parserInternals.c
index 0957a6e..026e6a1 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -913,6 +913,7 @@
 {
     xmlCharEncodingHandlerPtr handler;
 
+    if (ctxt == NULL) return(-1);
     switch (enc) {
 	case XML_CHAR_ENCODING_ERROR:
 	    __xmlErrEncoding(ctxt, XML_ERR_UNKNOWN_ENCODING,
@@ -1331,6 +1332,7 @@
 	            xmlCharEncoding enc) {
     xmlParserInputPtr inputStream;
 
+    if (input == NULL) return(NULL);
     if (xmlParserDebugEntities)
 	xmlGenericError(xmlGenericErrorContext, "new input from I/O\n");
     inputStream = xmlNewInputStream(ctxt);