Commit 4a7ae503 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

isExtender was missing a char % are acceptable in the internal subset if

* xmlInternald.c: isExtender was missing a char
* parser.c include/libxml/parser.h: % are acceptable in the
  internal subset if within a PUBLIC ID
Daniel
parent 8ab0f58f
Mon Feb 18 20:16:15 CET 2002 Daniel Veillard <daniel@veillard.com>
* xmlInternald.c: isExtender was missing a char
* parser.c include/libxml/parser.h: % are acceptable in the
internal subset if within a PUBLIC ID
Mon Feb 18 19:27:32 CET 2002 Daniel Veillard <daniel@veillard.com>
* SAX.c parserInternals.c valid.c: more work on the conformance
......
......@@ -112,7 +112,8 @@ typedef enum {
XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */
XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */
XML_PARSER_EPILOG, /* the Misc* after the last end tag */
XML_PARSER_IGNORE /* within an IGNORED section */
XML_PARSER_IGNORE, /* within an IGNORED section */
XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */
} xmlParserInputState;
/**
......
......@@ -727,6 +727,7 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
case XML_PARSER_ATTRIBUTE_VALUE:
case XML_PARSER_PI:
case XML_PARSER_SYSTEM_LITERAL:
case XML_PARSER_PUBLIC_LITERAL:
/* we just ignore it there */
return;
case XML_PARSER_EPILOG:
......@@ -2468,6 +2469,7 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
xmlChar cur;
xmlChar stop;
int count = 0;
xmlParserInputState oldstate = ctxt->instate;
SHRINK;
if (RAW == '"') {
......@@ -2491,6 +2493,7 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
"malloc of %d byte failed\n", size);
return(NULL);
}
ctxt->instate = XML_PARSER_PUBLIC_LITERAL;
cur = CUR;
while ((IS_PUBIDCHAR(cur)) && (cur != stop)) { /* checked */
if (len + 1 >= size) {
......@@ -2526,6 +2529,7 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
} else {
NEXT;
}
ctxt->instate = oldstate;
return(buf);
}
......@@ -3417,7 +3421,11 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
(ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Invalid URI: %s\n", URI);
ctxt->wellFormed = 0;
/*
* This really ought to be a well formedness error
* but the XML Core WG decided otherwise c.f. issue
* E26 of the XML erratas.
*/
} else {
if (uri->fragment != NULL) {
ctxt->errNo = XML_ERR_URI_FRAGMENT;
......@@ -3426,6 +3434,10 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
(ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Fragment not allowed: %s\n", URI);
/*
* Okay this is foolish to block those but not
* invalid URIs.
*/
ctxt->wellFormed = 0;
} else {
if ((ctxt->sax != NULL) &&
......@@ -3468,7 +3480,11 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
(ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Invalid URI: %s\n", URI);
ctxt->wellFormed = 0;
/*
* This really ought to be a well formedness error
* but the XML Core WG decided otherwise c.f. issue
* E26 of the XML erratas.
*/
} else {
if (uri->fragment != NULL) {
ctxt->errNo = XML_ERR_URI_FRAGMENT;
......@@ -3477,6 +3493,10 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
(ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Fragment not allowed: %s\n", URI);
/*
* Okay this is foolish to block those but not
* invalid URIs.
*/
ctxt->wellFormed = 0;
}
xmlFreeURI(uri);
......@@ -8647,6 +8667,15 @@ found_end_int_subset:
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
"PP: entering START_TAG\n");
#endif
break;
case XML_PARSER_PUBLIC_LITERAL:
xmlGenericError(xmlGenericErrorContext,
"PP: internal error, state == PUBLIC_LITERAL\n");
ctxt->instate = XML_PARSER_START_TAG;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
"PP: entering START_TAG\n");
#endif
break;
}
......
......@@ -817,7 +817,7 @@ xmlIsExtender(int c) {
case 0x0640: case 0x0E46: case 0x0EC6: case 0x3005:
case 0x3031: case 0x3032: case 0x3033: case 0x3034:
case 0x3035: case 0x309D: case 0x309E: case 0x30FC:
case 0x30FE:
case 0x30FD: case 0x30FE:
return 1;
default:
return 0;
......
Supports Markdown
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