Lines Matching refs:DTD
297 } DTD;
398 static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms);
400 static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms);
402 dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
405 DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
450 DTD *dtd);
538 DTD *m_dtd;
763 DTD *dtd)
820 if (dtd)
821 _dtd = dtd;
1020 DTD *newDtd = NULL;
1021 DTD *oldDtd = _dtd;
1136 /* The DTD instance referenced by _dtd is shared between the document's
1207 /* external parameter entity parsers share the DTD structure
2290 DTD * const dtd = _dtd;
2371 name = poolStoreString(&dtd->pool, enc,
2376 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
2377 poolDiscard(&dtd->pool);
2382 if (!dtd->hasParamEntityRefs || dtd->standalone) {
2752 DTD * const dtd = _dtd; /* save one level of indirection */
2766 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, tagNamePtr->str,0);
2768 const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
2771 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, name,
2963 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0);
3054 else if (dtd->defaultPrefix.binding) {
3055 binding = dtd->defaultPrefix.binding;
3829 DTD * const dtd = _dtd;
3937 &dtd->paramEntities,
3943 dtd->hasParamEntityRefs = XML_TRUE;
3964 if (dtd->keepProcessing && declEntity) {
3965 XML_Char *tem = poolStoreString(&dtd->pool,
3973 poolFinish(&dtd->pool);
3991 XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
3992 dtd->hasParamEntityRefs = XML_TRUE;
3995 &dtd->paramEntities,
4002 dtd->paramEntityRead = XML_FALSE;
4009 if (dtd->paramEntityRead) {
4010 if (!dtd->standalone &&
4015 /* if we didn't read the foreign DTD then this means that there
4016 is no external subset and we must reset dtd->hasParamEntityRefs
4019 dtd->hasParamEntityRefs = hadParamEntityRefs;
4020 /* end of DTD - no need to update dtd->keepProcessing */
4033 last chance to read the foreign DTD
4036 XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
4037 dtd->hasParamEntityRefs = XML_TRUE;
4039 ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities,
4045 dtd->paramEntityRead = XML_FALSE;
4052 if (dtd->paramEntityRead) {
4053 if (!dtd->standalone &&
4058 /* if we didn't read the foreign DTD then this means that there
4059 is no external subset and we must reset dtd->hasParamEntityRefs
4062 dtd->hasParamEntityRefs = hadParamEntityRefs;
4063 /* end of DTD - no need to update dtd->keepProcessing */
4108 if (dtd->keepProcessing && attlistDeclHandler)
4113 if (dtd->keepProcessing && attlistDeclHandler) {
4133 if (dtd->keepProcessing) {
4160 if (dtd->keepProcessing) {
4166 &dtd->pool);
4169 attVal = poolStart(&dtd->pool);
4170 poolFinish(&dtd->pool);
4197 if (dtd->keepProcessing) {
4202 declEntity->textPtr = poolStart(&dtd->entityValuePool);
4203 declEntity->textLen = (int)(poolLength(&dtd->entityValuePool));
4204 poolFinish(&dtd->entityValuePool);
4217 poolDiscard(&dtd->entityValuePool);
4226 dtd->hasParamEntityRefs = XML_TRUE;
4242 if (!dtd->standalone
4254 &dtd->paramEntities,
4264 if (dtd->keepProcessing && declEntity) {
4265 declEntity->systemId = poolStoreString(&dtd->pool, enc,
4271 poolFinish(&dtd->pool);
4277 if (dtd->keepProcessing && declEntity && entityDeclHandler) {
4291 if (dtd->keepProcessing && declEntity) {
4292 declEntity->notation = poolStoreString(&dtd->pool, enc, s, next);
4295 poolFinish(&dtd->pool);
4325 if (dtd->keepProcessing) {
4326 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
4329 declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name,
4334 poolDiscard(&dtd->pool);
4338 poolFinish(&dtd->pool);
4350 poolDiscard(&dtd->pool);
4357 if (dtd->keepProcessing) {
4358 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
4361 declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities,
4366 poolDiscard(&dtd->pool);
4370 poolFinish(&dtd->pool);
4382 poolDiscard(&dtd->pool);
4481 if (dtd->scaffIndex) {
4482 int *temp = (int *)REALLOC(dtd->scaffIndex,
4486 dtd->scaffIndex = temp;
4496 if (dtd->in_eldecl) {
4500 dtd->scaffIndex[dtd->scaffLevel] = myindex;
4501 dtd->scaffLevel++;
4502 dtd->scaffold[myindex].type = XML_CTYPE_SEQ;
4511 if (dtd->in_eldecl && elementDeclHandler)
4517 if (dtd->in_eldecl
4519 && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4522 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4532 dtd->hasParamEntityRefs = XML_TRUE;
4534 dtd->keepProcessing = dtd->standalone;
4538 name = poolStoreString(&dtd->pool, enc,
4543 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
4544 poolDiscard(&dtd->pool);
4550 (dtd->standalone
4552 : !dtd->hasParamEntityRefs)) {
4559 dtd->keepProcessing = dtd->standalone;
4580 dtd->paramEntityRead = XML_FALSE;
4592 if (!dtd->paramEntityRead) {
4593 dtd->keepProcessing = dtd->standalone;
4598 dtd->keepProcessing = dtd->standalone;
4603 if (!dtd->standalone &&
4616 dtd->scaffLevel = 0;
4617 dtd->scaffCount = 0;
4618 dtd->in_eldecl = XML_TRUE;
4625 dtd->in_eldecl) {
4641 dtd->in_eldecl = XML_FALSE;
4646 if (dtd->in_eldecl) {
4647 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4666 if (dtd->in_eldecl) {
4676 dtd->scaffold[myindex].type = XML_CTYPE_NAME;
4677 dtd->scaffold[myindex].quant = quant;
4682 dtd->scaffold[myindex].name = name;
4685 dtd->contentStringLen += nameLen;
4703 if (dtd->in_eldecl) {
4706 dtd->scaffLevel--;
4707 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant;
4708 if (dtd->scaffLevel == 0) {
4716 dtd->in_eldecl = XML_FALSE;
4717 dtd->contentStringLen = 0;
4745 if (dtd->keepProcessing && entityDeclHandler)
4753 if (dtd->keepProcessing && attlistDeclHandler)
4994 DTD * const dtd = _dtd; /* save one level of indirection */
5067 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
5072 if (pool == &dtd->pool) /* are we called from prolog? */
5077 (dtd->standalone
5079 : !dtd->hasParamEntityRefs);
5081 checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone;
5145 DTD * const dtd = _dtd; /* save one level of indirection */
5146 STRING_POOL *pool = &(dtd->entityValuePool);
5176 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
5185 dtd->keepProcessing = dtd->standalone;
5196 dtd->paramEntityRead = XML_FALSE;
5208 if (!dtd->paramEntityRead)
5209 dtd->keepProcessing = dtd->standalone;
5212 dtd->keepProcessing = dtd->standalone;
5455 DTD * const dtd = _dtd; /* save one level of indirection */
5462 if (!poolAppendChar(&dtd->pool, *s))
5465 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5467 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
5471 if (prefix->name == poolStart(&dtd->pool))
5472 poolFinish(&dtd->pool);
5474 poolDiscard(&dtd->pool);
5486 DTD * const dtd = _dtd; /* save one level of indirection */
5489 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5491 name = poolStoreString(&dtd->pool, enc, start, end);
5496 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, name, sizeof(ATTRIBUTE_ID));
5500 poolDiscard(&dtd->pool);
5502 poolFinish(&dtd->pool);
5512 id->prefix = &dtd->defaultPrefix;
5514 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, name + 6, sizeof(PREFIX));
5524 if (!poolAppendChar(&dtd->pool, name[j]))
5527 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5529 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
5533 if (id->prefix->name == poolStart(&dtd->pool))
5534 poolFinish(&dtd->pool);
5536 poolDiscard(&dtd->pool);
5550 DTD * const dtd = _dtd; /* save one level of indirection */
5554 if (dtd->defaultPrefix.binding) {
5559 len = dtd->defaultPrefix.binding->uriLen;
5563 if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i]))
5568 hashTableIterInit(&iter, &(dtd->prefixes));
5595 hashTableIterInit(&iter, &(dtd->generalEntities));
5619 DTD * const dtd = _dtd; /* save one level of indirection */
5627 e = (ENTITY *)lookup(parser, &dtd->generalEntities, poolStart(&tempPool), 0);
5638 prefix = &dtd->defaultPrefix;
5642 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&tempPool),
5647 prefix->name = poolCopyString(&dtd->pool, prefix->name);
5699 static DTD *
5702 DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD));
5733 dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms)
5775 dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms)
5802 /* Do a deep copy of the DTD. Return 0 for out of memory, non-zero otherwise.
5803 The new DTD has already been initialized.
5806 dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
6340 DTD * const dtd = _dtd; /* save one level of indirection */
6344 if (!dtd->scaffIndex) {
6345 dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int));
6346 if (!dtd->scaffIndex)
6348 dtd->scaffIndex[0] = 0;
6351 if (dtd->scaffCount >= dtd->scaffSize) {
6353 if (dtd->scaffold) {
6355 REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
6358 dtd->scaffSize *= 2;
6365 dtd->scaffSize = INIT_SCAFFOLD_ELEMENTS;
6367 dtd->scaffold = temp;
6369 next = dtd->scaffCount++;
6370 me = &dtd->scaffold[next];
6371 if (dtd->scaffLevel) {
6372 CONTENT_SCAFFOLD *parent = &dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel-1]];
6374 dtd->scaffold[parent->lastchild].nextsib = next;
6392 DTD * const dtd = _dtd; /* save one level of indirection */
6393 dest->type = dtd->scaffold[src_node].type;
6394 dest->quant = dtd->scaffold[src_node].quant;
6398 src = dtd->scaffold[src_node].name;
6411 dest->numchildren = dtd->scaffold[src_node].childcnt;
6414 for (i = 0, cn = dtd->scaffold[src_node].firstchild;
6416 i++, cn = dtd->scaffold[cn].nextsib) {
6426 DTD * const dtd = _dtd; /* save one level of indirection */
6430 int allocsize = (dtd->scaffCount * sizeof(XML_Content)
6431 + (dtd->contentStringLen * sizeof(XML_Char)));
6437 str = (XML_Char *) (&ret[dtd->scaffCount]);
6450 DTD * const dtd = _dtd; /* save one level of indirection */
6451 const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end);
6456 ret = (ELEMENT_TYPE *) lookup(parser, &dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
6460 poolDiscard(&dtd->pool);
6462 poolFinish(&dtd->pool);