Commit 1984094c authored by Daniel Veillard's avatar Daniel Veillard
Browse files

Robin Berjon <robin@knowscape.com> found a case where non-wellformed XML

* parser.c: Robin Berjon <robin@knowscape.com> found a case
  where non-wellformed XML declaractions were not detected.
Daniel
parent 913d6e09
Thu Nov 29 17:10:22 CET 2001 Daniel Veillard <daniel@veillard.com>
* parser.c: Robin Berjon <robin@knowscape.com> found a case
where non-wellformed XML declaractions were not detected.
Wed Nov 28 15:41:40 CET 2001 Daniel Veillard <daniel@veillard.com>
* xpointer.c: fixed a compilation bug pointed by Danny Jamshy
......
......@@ -7316,21 +7316,28 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) {
SKIP_BLANKS;
/*
* We should have the VersionInfo here.
* We must have the VersionInfo here.
*/
version = xmlParseVersionInfo(ctxt);
if (version == NULL)
version = xmlCharStrdup(XML_DEFAULT_VERSION);
else if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
/*
* TODO: Blueberry should be detected here
*/
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
ctxt->sax->warning(ctxt->userData, "Unsupported version '%s'\n",
version);
if (version == NULL) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Malformed declaration expecting version\n");
ctxt->wellFormed = 0;
ctxt->disableSAX = 1;
} else {
if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
/*
* TODO: Blueberry should be detected here
*/
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
ctxt->sax->warning(ctxt->userData, "Unsupported version '%s'\n",
version);
}
if (ctxt->version != NULL)
xmlFree(ctxt->version);
ctxt->version = version;
}
ctxt->version = xmlStrdup(version);
xmlFree(version);
/*
* We may have the encoding declaration
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment