diff --git a/ChangeLog b/ChangeLog index d4d97f4c..75d7082b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Tue Oct 23 14:32:04 CEST 2001 Daniel Veillard + + * parser.c: fixed an erroneous validation bug when PE refs + occurs in external parsed entities referenced from the + internals subset + * test/valid/index.xml test/valid/dtds/nitf-2-5.dtd + test/valid/dtds/NewsMLv1.0.dtd result/valid/index.xml*: + added the associated testcase, it's a nice one. + * HTMLparser.c: generate the DTD node as HTML still ... + * HTMLtree.c: fixed errors in Set/GetMetaEncoding + Mon Oct 22 14:20:17 CEST 2001 Daniel Veillard * HTMLparser.c: fixed a bug in htmlNewDoc() diff --git a/HTMLparser.c b/HTMLparser.c index 428248ed..0b9061d0 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -1823,7 +1823,7 @@ htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *ExternalID) { cur->_private = NULL; if ((ExternalID != NULL) || (URI != NULL)) - xmlCreateIntSubset(cur, BAD_CAST "html", ExternalID, URI); + xmlCreateIntSubset(cur, BAD_CAST "HTML", ExternalID, URI); return(cur); } diff --git a/HTMLtree.c b/HTMLtree.c index 7041dbe2..cd9417c6 100644 --- a/HTMLtree.c +++ b/HTMLtree.c @@ -54,7 +54,7 @@ htmlGetMetaEncoding(htmlDocPtr doc) { * Search the html */ while (cur != NULL) { - if (cur->name != NULL) { + if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { if (xmlStrEqual(cur->name, BAD_CAST"html")) break; if (xmlStrEqual(cur->name, BAD_CAST"head")) @@ -72,7 +72,7 @@ htmlGetMetaEncoding(htmlDocPtr doc) { * Search the head */ while (cur != NULL) { - if (cur->name != NULL) { + if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { if (xmlStrEqual(cur->name, BAD_CAST"head")) break; if (xmlStrEqual(cur->name, BAD_CAST"meta")) @@ -90,7 +90,7 @@ found_head: */ found_meta: while (cur != NULL) { - if (cur->name != NULL) { + if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { if (xmlStrEqual(cur->name, BAD_CAST"meta")) { xmlAttrPtr attr = cur->properties; int http; @@ -180,7 +180,7 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) { * Search the html */ while (cur != NULL) { - if (cur->name != NULL) { + if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { if (xmlStrcasecmp(cur->name, BAD_CAST"html") == 0) break; if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0) @@ -198,7 +198,7 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) { * Search the head */ while (cur != NULL) { - if (cur->name != NULL) { + if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0) break; if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) @@ -237,7 +237,7 @@ found_meta: * encoding informations */ while (cur != NULL) { - if (cur->name != NULL) { + if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) { if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) { xmlAttrPtr attr = cur->properties; int http; diff --git a/parser.c b/parser.c index 0a580f50..ab5ea0ad 100644 --- a/parser.c +++ b/parser.c @@ -2085,7 +2085,8 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) { ctxt->wellFormed = 0; ctxt->disableSAX = 1; } - if ((ctxt->inSubset == 1) && (tmp == '%')) { + if ((tmp == '%') && (ctxt->inSubset == 1) && + (ctxt->inputNr == 1)) { ctxt->errNo = XML_ERR_ENTITY_PE_INTERNAL; if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) ctxt->sax->error(ctxt->userData, diff --git a/result/valid/index.xml b/result/valid/index.xml new file mode 100644 index 00000000..d0ab20da --- /dev/null +++ b/result/valid/index.xml @@ -0,0 +1,808 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + 20011022T154508Z + + + + + afp.com + 20011022 + mmd--deutsch--journal--spo + 1 + urn:NewsML:afp.com:20011022:mmd--deutsch--journal--spo:1 + + HINTERGRUND + + + + 20011022T154508Z + 20011022T154508Z + + + + + + + + + + + + + + Berliner SPD führt Gespräche mit FDP und Grünen + + + + + + INFOGRAFIK: Das Berliner Wahlergebnis + + + + + + Schwierige Koalitionsverhandlungen in Berlin + + + + + + Die Lieblingsfarben des Kanzlers sind Rot Gelb Grün + + + + + + INFOGRAFIK: Wen wählt Wowereit? + + + + + + CDU ist auch in kommunalen Rathäusern der Verlierer + + + + + + Gutes Abschneiden der PDS hat verschiedene Gründe + + + + + + Ans Regieren hat sich Klaus Wowereit gewöhnt + + + + + + Steffel brachte CDU nicht auf Erfolgskurs + + + + + + Sibyll Klotz: Vollblutpolitikerin mit "Berliner Schnauze" + + + + + + Mit Gysi muss weiter gerechnet werden + + + + + + Rexrodt - das Stehaufmännchen der Berliner FDP + + + + + + diff --git a/result/valid/index.xml.err b/result/valid/index.xml.err new file mode 100644 index 00000000..e69de29b diff --git a/result/valid/rss.xml b/result/valid/rss.xml index d3d1aad2..642fb808 100644 --- a/result/valid/rss.xml +++ b/result/valid/rss.xml @@ -17,7 +17,6 @@ Based on RSS DTD originally created by Lars Marius Garshol - larsga@ifi.uio.no. - $Id: rss.xml,v 1.1 2001/04/20 13:48:21 veillard Exp $ --> diff --git a/result/valid/rss.xml.err b/result/valid/rss.xml.err index 307a8ccf..98941d02 100644 --- a/result/valid/rss.xml.err +++ b/result/valid/rss.xml.err @@ -1,3 +1,3 @@ -./test/valid/rss.xml:178: validity error: Element rss doesn't carry attribute version +./test/valid/rss.xml:177: validity error: Element rss doesn't carry attribute version ^ diff --git a/test/valid/dtds/NewsMLv1.0.dtd b/test/valid/dtds/NewsMLv1.0.dtd new file mode 100644 index 00000000..5799b298 --- /dev/null +++ b/test/valid/dtds/NewsMLv1.0.dtd @@ -0,0 +1,1578 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/valid/dtds/nitf-2-5.dtd b/test/valid/dtds/nitf-2-5.dtd new file mode 100644 index 00000000..253e6205 --- /dev/null +++ b/test/valid/dtds/nitf-2-5.dtd @@ -0,0 +1,1004 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/valid/index.xml b/test/valid/index.xml new file mode 100644 index 00000000..2a0e6714 --- /dev/null +++ b/test/valid/index.xml @@ -0,0 +1,111 @@ + + + %nitf; +]> + + + + 20011022T154508Z + + + + + afp.com + 20011022 + mmd--deutsch--journal--spo + 1 + urn:NewsML:afp.com:20011022:mmd--deutsch--journal--spo:1 + + HINTERGRUND + + + + 20011022T154508Z + 20011022T154508Z + + + + + + + + + + + + + + Berliner SPD führt Gespräche mit FDP und Grünen + + + + + + INFOGRAFIK: Das Berliner Wahlergebnis + + + + + + Schwierige Koalitionsverhandlungen in Berlin + + + + + + Die Lieblingsfarben des Kanzlers sind Rot Gelb Grün + + + + + + INFOGRAFIK: Wen wählt Wowereit? + + + + + + CDU ist auch in kommunalen Rathäusern der Verlierer + + + + + + Gutes Abschneiden der PDS hat verschiedene Gründe + + + + + + Ans Regieren hat sich Klaus Wowereit gewöhnt + + + + + + Steffel brachte CDU nicht auf Erfolgskurs + + + + + + Sibyll Klotz: Vollblutpolitikerin mit "Berliner Schnauze" + + + + + + Mit Gysi muss weiter gerechnet werden + + + + + + Rexrodt - das Stehaufmännchen der Berliner FDP + + + + + + diff --git a/test/valid/rss.xml b/test/valid/rss.xml index 429e0fe6..5d6102d8 100644 --- a/test/valid/rss.xml +++ b/test/valid/rss.xml @@ -17,7 +17,6 @@ Based on RSS DTD originally created by Lars Marius Garshol - larsga@ifi.uio.no. - $Id: rss-0.91.dtd,v 1.1 1999/07/25 07:59:31 danda Exp $ -->