Diff for /XML/HTMLparser.c between versions 1.84 and 1.85

version 1.84, 2000/11/17 16:08:49 version 1.85, 2000/11/21 18:45:36
Line 855  htmlCheckImplied(htmlParserCtxtPtr ctxt, Line 855  htmlCheckImplied(htmlParserCtxtPtr ctxt,
     }      }
     if ((xmlStrEqual(newtag, BAD_CAST"body")) || (xmlStrEqual(newtag, BAD_CAST"head")))      if ((xmlStrEqual(newtag, BAD_CAST"body")) || (xmlStrEqual(newtag, BAD_CAST"head")))
         return;          return;
     if (ctxt->nameNr <= 1) {      if ((ctxt->nameNr <= 1) && 
         if ((xmlStrEqual(newtag, BAD_CAST"script")) ||          ((xmlStrEqual(newtag, BAD_CAST"script")) ||
             (xmlStrEqual(newtag, BAD_CAST"style")) ||           (xmlStrEqual(newtag, BAD_CAST"style")) ||
             (xmlStrEqual(newtag, BAD_CAST"meta")) ||           (xmlStrEqual(newtag, BAD_CAST"meta")) ||
             (xmlStrEqual(newtag, BAD_CAST"link")) ||           (xmlStrEqual(newtag, BAD_CAST"link")) ||
             (xmlStrEqual(newtag, BAD_CAST"title")) ||           (xmlStrEqual(newtag, BAD_CAST"title")) ||
             (xmlStrEqual(newtag, BAD_CAST"base"))) {           (xmlStrEqual(newtag, BAD_CAST"base")))) {
             /*               /* 
              * dropped OBJECT ... i you put it first BODY will be               * dropped OBJECT ... i you put it first BODY will be
              * assumed !               * assumed !
Line 872  htmlCheckImplied(htmlParserCtxtPtr ctxt, Line 872  htmlCheckImplied(htmlParserCtxtPtr ctxt,
             htmlnamePush(ctxt, xmlStrdup(BAD_CAST"head"));              htmlnamePush(ctxt, xmlStrdup(BAD_CAST"head"));
             if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))              if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
                 ctxt->sax->startElement(ctxt->userData, BAD_CAST"head", NULL);                  ctxt->sax->startElement(ctxt->userData, BAD_CAST"head", NULL);
         } else {      } else if ((!xmlStrEqual(newtag, BAD_CAST"noframes")) &&
                  (!xmlStrEqual(newtag, BAD_CAST"frame")) &&
                  (!xmlStrEqual(newtag, BAD_CAST"frameset"))) {
           int i;
           for (i = 0;i < ctxt->nameNr;i++) {
               if (xmlStrEqual(ctxt->nameTab[i], BAD_CAST"body")) {
                   return;
               }
               if (xmlStrEqual(ctxt->nameTab[i], BAD_CAST"head")) {
                   return;
               }
           }
               
 #ifdef DEBUG  #ifdef DEBUG
             xmlGenericError(xmlGenericErrorContext,"Implied element body: pushed body\n");          xmlGenericError(xmlGenericErrorContext,"Implied element body: pushed body\n");
 #endif      #endif    
             htmlnamePush(ctxt, xmlStrdup(BAD_CAST"body"));          htmlnamePush(ctxt, xmlStrdup(BAD_CAST"body"));
             if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))          if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
                 ctxt->sax->startElement(ctxt->userData, BAD_CAST"body", NULL);              ctxt->sax->startElement(ctxt->userData, BAD_CAST"body", NULL);
         }  
     }      }
 }  }
   
Line 2933  htmlParseStartTag(htmlParserCtxtPtr ctxt Line 2944  htmlParseStartTag(htmlParserCtxtPtr ctxt
     htmlCheckImplied(ctxt, name);      htmlCheckImplied(ctxt, name);
   
     /*      /*
        * Avoid html at any level > 0, head at any level != 1
        * or any attempt to recurse body
        */
       if ((ctxt->nameNr > 0) && (xmlStrEqual(name, BAD_CAST"html"))) {
           if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
               ctxt->sax->error(ctxt->userData, 
                "htmlParseStartTag: misplaced <html> tag\n");
           ctxt->wellFormed = 0;
           xmlFree(name);
           return;
       }
       if ((ctxt->nameNr != 1) && 
           (xmlStrEqual(name, BAD_CAST"head"))) {
           if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
               ctxt->sax->error(ctxt->userData, 
                "htmlParseStartTag: misplaced <head> tag\n");
           ctxt->wellFormed = 0;
           xmlFree(name);
           return;
       }
       if (xmlStrEqual(name, BAD_CAST"body")) {
           int i;
           for (i = 0;i < ctxt->nameNr;i++) {
               if (xmlStrEqual(ctxt->nameTab[i], BAD_CAST"body")) {
                   if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
                       ctxt->sax->error(ctxt->userData, 
                        "htmlParseStartTag: misplaced <body> tag\n");
                   ctxt->wellFormed = 0;
                   xmlFree(name);
                   return;
               }
           }
       }
   
       /*
      * Now parse the attributes, it ends up with the ending       * Now parse the attributes, it ends up with the ending
      *       *
      * (S Attribute)* S?       * (S Attribute)* S?

Removed from v.1.84  
changed lines
  Added in v.1.85


Webmaster