[xml] DOCTYPE in HTML parser



In the HTML parser, the public ID literal in the DOCTYPE seems to be parsed
incorrectly if it is in single quotes. This patch fixed it for me (makes it
consistent with the double quotes case above).

*** HTMLparser.c        22 Mar 2003 00:04:03 -0000      1.138
--- HTMLparser.c        27 Mar 2003 19:14:28 -0000
***************
*** 2631,2639 ****
      } else if (CUR == '\'') {
          NEXT;
        q = CUR_PTR;
!       while ((IS_LETTER(CUR)) && (CUR != '\''))
            NEXT;
!       if (!IS_LETTER(CUR)) {
            if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
                ctxt->sax->error(ctxt->userData, "Unfinished PubidLiteral\n");
            ctxt->wellFormed = 0;
--- 2631,2639 ----
      } else if (CUR == '\'') {
          NEXT;
        q = CUR_PTR;
!       while ((IS_PUBIDCHAR(CUR)) && (CUR != '\''))
            NEXT;
!       if (CUR != '\'') {
            if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
                ctxt->sax->error(ctxt->userData, "Unfinished PubidLiteral\n");
            ctxt->wellFormed = 0;


Also, I got an error compiling tree.c after getting the latest CVS, fix
below.

Index: tree.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/tree.c,v
retrieving revision 1.252
diff -d -u -3 -c -r1.252 tree.c
*** tree.c      24 Mar 2003 18:39:54 -0000      1.252
--- tree.c      27 Mar 2003 19:24:52 -0000
***************
*** 2970,2977 ****
      if ((cur->type == XML_DOCUMENT_NODE) ||
  #ifdef LIBXML_DOCB_ENABLED
        (cur->type == XML_DOCB_DOCUMENT_NODE) ||
-       (cur->type == XML_HTML_DOCUMENT_NODE)) {
  #endif
        xmlFreeDoc((xmlDocPtr) cur);
        return;
      }
--- 2970,2977 ----
      if ((cur->type == XML_DOCUMENT_NODE) ||
  #ifdef LIBXML_DOCB_ENABLED
        (cur->type == XML_DOCB_DOCUMENT_NODE) ||
  #endif
+       (cur->type == XML_HTML_DOCUMENT_NODE)) {
        xmlFreeDoc((xmlDocPtr) cur);
        return;
      }


Thanks,
James




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