Don't need to check system identifiers

This commit is contained in:
James Clark 1997-12-10 07:57:10 +00:00
parent 9f41c277f9
commit 8b6b5840ee
4 changed files with 1 additions and 62 deletions

View file

@ -10,8 +10,7 @@
PREFIX(getAtts), \
PREFIX(charRefNumber), \
PREFIX(updatePosition), \
PREFIX(isPublicId), \
PREFIX(isSystemId)
PREFIX(isPublicId)
#define VTABLE2 \
PREFIX(encode), \

View file

@ -121,8 +121,6 @@ struct encoding {
POSITION *);
int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
const char **badPtr);
int (*isSystemId)(const ENCODING *enc, const char *ptr, const char *end,
const char **badPtr);
int (*encode)(const ENCODING *enc,
int charNum,
char *buf);
@ -196,9 +194,6 @@ the content of a literal that has already been returned by XmlTok. */
#define XmlIsPublicId(enc, ptr, end, badPtr) \
(((enc)->isPublicId)(enc, ptr, end, badPtr))
#define XmlIsSystemId(enc, ptr, end, badPtr) \
(((enc)->isSystemId)(enc, ptr, end, badPtr))
#define XmlEncode(enc, ch, buf) \
(((enc)->encode)(enc, ch, buf))

View file

@ -1116,53 +1116,6 @@ int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
return 1;
}
static
int PREFIX(isSystemId)(const ENCODING *enc, const char *ptr, const char *end,
const char **badPtr)
{
ptr += MINBPC;
end -= MINBPC;
for (; ptr != end; ptr += MINBPC) {
switch (BYTE_TYPE(enc, ptr)) {
case BT_DIGIT:
case BT_HEX:
case BT_MINUS:
case BT_APOS:
case BT_LPAR:
case BT_RPAR:
case BT_PLUS:
case BT_COMMA:
case BT_SOL:
case BT_AMP:
case BT_SEMI:
case BT_EQUALS:
case BT_QUEST:
case BT_EXCL:
case BT_AST:
case BT_PERCNT:
break;
case BT_NAME:
case BT_NMSTRT:
if (BYTE_TO_ASCII(enc, ptr) & ~0x7f) {
*badPtr = ptr;
return 0;
}
break;
default:
switch (BYTE_TO_ASCII(enc, ptr)) {
case '@':
case '$':
break;
default:
*badPtr = ptr;
return 0;
}
break;
}
}
return 1;
}
/* This must only be called for a well-formed start-tag or empty element tag.
Returns the number of attributes. Pointers to the first attsMax attributes
are stored in atts. */

View file

@ -438,14 +438,8 @@ checkProlog(DTD *dtd, const char *s, const char *end,
break;
}
case XML_ROLE_DOCTYPE_SYSTEM_ID:
if (!XmlIsSystemId(*enc, s, next, nextPtr))
return syntaxError;
dtd->containsRef = 1;
break;
case XML_ROLE_NOTATION_SYSTEM_ID:
if (!XmlIsSystemId(*enc, s, next, nextPtr))
return syntaxError;
break;
case XML_ROLE_DOCTYPE_PUBLIC_ID:
case XML_ROLE_ENTITY_PUBLIC_ID:
case XML_ROLE_NOTATION_PUBLIC_ID:
@ -485,8 +479,6 @@ checkProlog(DTD *dtd, const char *s, const char *end,
}
break;
case XML_ROLE_ENTITY_SYSTEM_ID:
if (!XmlIsSystemId(*enc, s, next, nextPtr))
return syntaxError;
if (entityNamePtr) {
const char *name = poolStoreString(&dtd->pool, *enc, entityNamePtr, entityNameEnd);
entity = (ENTITY *)lookup(&dtd->generalEntities, name, sizeof(ENTITY));