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/ChangeLog b/ChangeLog
index 3f32cde..95b668e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Mar  3 17:44:10 CET 2006 Rob Richards <rrichards@ctindustries.net>
+
+	* valid.c: fix HTML attribute ID checking for input element.
+	  Maintain current attribute "name" behavior for now.
+
 Thu Mar  2 18:59:50 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
 
 	* tree.c: Bundled lookup of attr-nodes and retrieving their
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) {