fix HTML attribute ID checking for input element. Maintain current

* valid.c: fix HTML attribute ID checking for input element.
  Maintain current attribute "name" behavior for now.
diff --git a/valid.c b/valid.c
index 4fcf447..1bd0ef9 100644
--- a/valid.c
+++ b/valid.c
@@ -2712,9 +2712,9 @@
     if ((doc->intSubset == NULL) && (doc->extSubset == NULL)) {
 	return(0);
     } else if (doc->type == XML_HTML_DOCUMENT_NODE) {
-        if (((xmlStrEqual(BAD_CAST "id", attr->name)) ||
-	    (xmlStrEqual(BAD_CAST "name", attr->name))) &&
-	    ((elem != NULL) && (!xmlStrEqual(elem->name, BAD_CAST "input"))))
+        if ((xmlStrEqual(BAD_CAST "id", attr->name)) ||
+	    ((xmlStrEqual(BAD_CAST "name", attr->name)) &&
+	    ((elem == NULL) || (!xmlStrEqual(elem->name, BAD_CAST "input")))))
 	    return(1);
 	return(0);    
     } else if (elem == NULL) {