mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-05 05:05:00 +00:00
Fix bug with DTD-less docs.
This commit is contained in:
parent
6a9cec2f7a
commit
7af19499b0
1 changed files with 14 additions and 1 deletions
|
@ -44,6 +44,7 @@ int prolog0(PROLOG_STATE *state,
|
|||
const ENCODING *enc)
|
||||
{
|
||||
switch (tok) {
|
||||
case XML_TOK_BOM:
|
||||
case XML_TOK_PI:
|
||||
case XML_TOK_COMMENT:
|
||||
return XML_ROLE_NONE;
|
||||
|
@ -54,6 +55,12 @@ int prolog0(PROLOG_STATE *state,
|
|||
break;
|
||||
state->handler = doctype0;
|
||||
return XML_ROLE_NONE;
|
||||
case XML_TOK_START_TAG_WITH_ATTS:
|
||||
case XML_TOK_START_TAG_NO_ATTS:
|
||||
case XML_TOK_EMPTY_ELEMENT_WITH_ATTS:
|
||||
case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
|
||||
state->handler = error;
|
||||
return XML_ROLE_INSTANCE_START;
|
||||
}
|
||||
return syntaxError(state);
|
||||
}
|
||||
|
@ -69,6 +76,12 @@ int prolog1(PROLOG_STATE *state,
|
|||
case XML_TOK_PI:
|
||||
case XML_TOK_COMMENT:
|
||||
return XML_ROLE_NONE;
|
||||
case XML_TOK_START_TAG_WITH_ATTS:
|
||||
case XML_TOK_START_TAG_NO_ATTS:
|
||||
case XML_TOK_EMPTY_ELEMENT_WITH_ATTS:
|
||||
case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
|
||||
state->handler = error;
|
||||
return XML_ROLE_INSTANCE_START;
|
||||
}
|
||||
return syntaxError(state);
|
||||
}
|
||||
|
@ -271,7 +284,7 @@ int entity2(PROLOG_STATE *state,
|
|||
}
|
||||
break;
|
||||
case XML_TOK_LITERAL:
|
||||
state->handler = entity4;
|
||||
state->handler = declClose;
|
||||
return XML_ROLE_ENTITY_VALUE;
|
||||
}
|
||||
return syntaxError(state);
|
||||
|
|
Loading…
Add table
Reference in a new issue