[libxml2] Recognize ID attribute in HTML without DOCTYPE



commit f3c06692e0d200ae0d35b5b3c31de8c56aa99ac6
Author: Daniel Veillard <veillard redhat com>
Date:   Fri Oct 16 16:47:58 2009 +0200

    Recognize ID attribute in HTML without DOCTYPE
    
    * valid.c: xmlIsID() was short-circuiting the case where there
      was no DTD.

 valid.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/valid.c b/valid.c
index 37b55d0..2cb32f3 100644
--- a/valid.c
+++ b/valid.c
@@ -2679,7 +2679,8 @@ xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
         (!strcmp((char *) attr->ns->prefix, "xml")))
 	return(1);
     if (doc == NULL) return(0);
-    if ((doc->intSubset == NULL) && (doc->extSubset == NULL)) {
+    if ((doc->intSubset == NULL) && (doc->extSubset == NULL) &&
+        (doc->type != XML_HTML_DOCUMENT_NODE)) {
 	return(0);
     } else if (doc->type == XML_HTML_DOCUMENT_NODE) {
         if ((xmlStrEqual(BAD_CAST "id", attr->name)) ||



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