Lines Matching refs:DTD
289 } DTD;
390 static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms);
392 static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms);
394 dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
397 DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
442 DTD *dtd);
530 DTD *m_dtd;
728 DTD *dtd)
785 if (dtd)
786 _dtd = dtd;
985 DTD *newDtd = NULL;
986 DTD *oldDtd = _dtd;
1101 /* The DTD instance referenced by _dtd is shared between the document's
1172 /* external parameter entity parsers share the DTD structure
2240 DTD * const dtd = _dtd;
2321 name = poolStoreString(&dtd->pool, enc,
2326 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
2327 poolDiscard(&dtd->pool);
2332 if (!dtd->hasParamEntityRefs || dtd->standalone) {
2702 DTD * const dtd = _dtd; /* save one level of indirection */
2716 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, tagNamePtr->str,0);
2718 const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
2721 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, name,
2913 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0);
3002 else if (dtd->defaultPrefix.binding) {
3003 binding = dtd->defaultPrefix.binding;
3777 DTD * const dtd = _dtd;
3885 &dtd->paramEntities,
3891 dtd->hasParamEntityRefs = XML_TRUE;
3912 if (dtd->keepProcessing && declEntity) {
3913 XML_Char *tem = poolStoreString(&dtd->pool,
3921 poolFinish(&dtd->pool);
3939 XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
3940 dtd->hasParamEntityRefs = XML_TRUE;
3943 &dtd->paramEntities,
3950 dtd->paramEntityRead = XML_FALSE;
3957 if (dtd->paramEntityRead) {
3958 if (!dtd->standalone &&
3963 /* if we didn't read the foreign DTD then this means that there
3964 is no external subset and we must reset dtd->hasParamEntityRefs
3967 dtd->hasParamEntityRefs = hadParamEntityRefs;
3968 /* end of DTD - no need to update dtd->keepProcessing */
3981 last chance to read the foreign DTD
3984 XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
3985 dtd->hasParamEntityRefs = XML_TRUE;
3987 ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities,
3993 dtd->paramEntityRead = XML_FALSE;
4000 if (dtd->paramEntityRead) {
4001 if (!dtd->standalone &&
4006 /* if we didn't read the foreign DTD then this means that there
4007 is no external subset and we must reset dtd->hasParamEntityRefs
4010 dtd->hasParamEntityRefs = hadParamEntityRefs;
4011 /* end of DTD - no need to update dtd->keepProcessing */
4056 if (dtd->keepProcessing && attlistDeclHandler)
4061 if (dtd->keepProcessing && attlistDeclHandler) {
4081 if (dtd->keepProcessing) {
4108 if (dtd->keepProcessing) {
4114 &dtd->pool);
4117 attVal = poolStart(&dtd->pool);
4118 poolFinish(&dtd->pool);
4145 if (dtd->keepProcessing) {
4150 declEntity->textPtr = poolStart(&dtd->entityValuePool);
4151 declEntity->textLen = (int)(poolLength(&dtd->entityValuePool));
4152 poolFinish(&dtd->entityValuePool);
4165 poolDiscard(&dtd->entityValuePool);
4174 dtd->hasParamEntityRefs = XML_TRUE;
4190 if (!dtd->standalone
4202 &dtd->paramEntities,
4212 if (dtd->keepProcessing && declEntity) {
4213 declEntity->systemId = poolStoreString(&dtd->pool, enc,
4219 poolFinish(&dtd->pool);
4225 if (dtd->keepProcessing && declEntity && entityDeclHandler) {
4239 if (dtd->keepProcessing && declEntity) {
4240 declEntity->notation = poolStoreString(&dtd->pool, enc, s, next);
4243 poolFinish(&dtd->pool);
4273 if (dtd->keepProcessing) {
4274 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
4277 declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name,
4282 poolDiscard(&dtd->pool);
4286 poolFinish(&dtd->pool);
4298 poolDiscard(&dtd->pool);
4305 if (dtd->keepProcessing) {
4306 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
4309 declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities,
4314 poolDiscard(&dtd->pool);
4318 poolFinish(&dtd->pool);
4330 poolDiscard(&dtd->pool);
4429 if (dtd->scaffIndex) {
4430 int *temp = (int *)REALLOC(dtd->scaffIndex,
4434 dtd->scaffIndex = temp;
4444 if (dtd->in_eldecl) {
4448 dtd->scaffIndex[dtd->scaffLevel] = myindex;
4449 dtd->scaffLevel++;
4450 dtd->scaffold[myindex].type = XML_CTYPE_SEQ;
4459 if (dtd->in_eldecl && elementDeclHandler)
4465 if (dtd->in_eldecl
4467 && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4470 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4480 dtd->hasParamEntityRefs = XML_TRUE;
4482 dtd->keepProcessing = dtd->standalone;
4486 name = poolStoreString(&dtd->pool, enc,
4491 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
4492 poolDiscard(&dtd->pool);
4498 (dtd->standalone
4500 : !dtd->hasParamEntityRefs)) {
4507 dtd->keepProcessing = dtd->standalone;
4528 dtd->paramEntityRead = XML_FALSE;
4540 if (!dtd->paramEntityRead) {
4541 dtd->keepProcessing = dtd->standalone;
4546 dtd->keepProcessing = dtd->standalone;
4551 if (!dtd->standalone &&
4564 dtd->scaffLevel = 0;
4565 dtd->scaffCount = 0;
4566 dtd->in_eldecl = XML_TRUE;
4573 if (dtd->in_eldecl) {
4589 dtd->in_eldecl = XML_FALSE;
4594 if (dtd->in_eldecl) {
4595 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4614 if (dtd->in_eldecl) {
4624 dtd->scaffold[myindex].type = XML_CTYPE_NAME;
4625 dtd->scaffold[myindex].quant = quant;
4630 dtd
4633 dtd->contentStringLen += nameLen;
4651 if (dtd->in_eldecl) {
4654 dtd->scaffLevel--;
4655 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant;
4656 if (dtd->scaffLevel == 0) {
4664 dtd->in_eldecl = XML_FALSE;
4665 dtd->contentStringLen = 0;
4693 if (dtd->keepProcessing && entityDeclHandler)
4701 if (dtd->keepProcessing && attlistDeclHandler)
4942 DTD * const dtd = _dtd; /* save one level of indirection */
5015 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
5020 if (pool == &dtd->pool) /* are we called from prolog? */
5025 (dtd->standalone
5027 : !dtd->hasParamEntityRefs);
5029 checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone;
5093 DTD * const dtd = _dtd; /* save one level of indirection */
5094 STRING_POOL *pool = &(dtd->entityValuePool);
5124 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
5133 dtd->keepProcessing = dtd->standalone;
5144 dtd->paramEntityRead = XML_FALSE;
5156 if (!dtd->paramEntityRead)
5157 dtd->keepProcessing = dtd->standalone;
5160 dtd->keepProcessing = dtd->standalone;
5402 DTD * const dtd = _dtd; /* save one level of indirection */
5409 if (!poolAppendChar(&dtd->pool, *s))
5412 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5414 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
5418 if (prefix->name == poolStart(&dtd->pool))
5419 poolFinish(&dtd->pool);
5421 poolDiscard(&dtd->pool);
5433 DTD * const dtd = _dtd; /* save one level of indirection */
5436 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5438 name = poolStoreString(&dtd->pool, enc, start, end);
5443 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, name, sizeof(ATTRIBUTE_ID));
5447 poolDiscard(&dtd->pool);
5449 poolFinish(&dtd->pool);
5459 id->prefix = &dtd->defaultPrefix;
5461 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, name + 6, sizeof(PREFIX));
5471 if (!poolAppendChar(&dtd->pool, name[j]))
5474 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5476 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
5478 if (id->prefix->name == poolStart(&dtd->pool))
5479 poolFinish(&dtd->pool);
5481 poolDiscard(&dtd->pool);
5495 DTD * const dtd = _dtd; /* save one level of indirection */
5499 if (dtd->defaultPrefix.binding) {
5504 len = dtd->defaultPrefix.binding->uriLen;
5508 if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i]))
5513 hashTableIterInit(&iter, &(dtd->prefixes));
5540 hashTableIterInit(&iter, &(dtd->generalEntities));
5564 DTD * const dtd = _dtd; /* save one level of indirection */
5572 e = (ENTITY *)lookup(parser, &dtd->generalEntities, poolStart(&tempPool), 0);
5583 prefix = &dtd->defaultPrefix;
5587 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&tempPool),
5592 prefix->name = poolCopyString(&dtd->pool, prefix->name);
5644 static DTD *
5647 DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD));
5678 dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms)
5720 dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms)
5747 /* Do a deep copy of the DTD. Return 0 for out of memory, non-zero otherwise.
5748 The new DTD
5751 dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
6276 DTD * const dtd = _dtd; /* save one level of indirection */
6280 if (!dtd->scaffIndex) {
6281 dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int));
6282 if (!dtd->scaffIndex)
6284 dtd->scaffIndex[0] = 0;
6287 if (dtd->scaffCount >= dtd->scaffSize) {
6289 if (dtd->scaffold) {
6291 REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
6294 dtd->scaffSize *= 2;
6301 dtd->scaffSize = INIT_SCAFFOLD_ELEMENTS;
6303 dtd->scaffold = temp;
6305 next = dtd->scaffCount++;
6306 me = &dtd->scaffold[next];
6307 if (dtd->scaffLevel) {
6308 CONTENT_SCAFFOLD *parent = &dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel-1]];
6310 dtd->scaffold[parent->lastchild].nextsib = next;
6328 DTD * const dtd = _dtd; /* save one level of indirection */
6329 dest->type = dtd->scaffold[src_node].type;
6330 dest->quant = dtd->scaffold[src_node].quant;
6334 src = dtd->scaffold[src_node].name;
6347 dest->numchildren = dtd->scaffold[src_node].childcnt;
6350 for (i = 0, cn = dtd->scaffold[src_node].firstchild;
6352 i++, cn = dtd->scaffold[cn].nextsib) {
6362 DTD * const dtd
6366 int allocsize = (dtd->scaffCount * sizeof(XML_Content)
6367 + (dtd->contentStringLen * sizeof(XML_Char)));
6373 str = (XML_Char *) (&ret[dtd->scaffCount]);
6386 DTD * const dtd = _dtd; /* save one level of indirection */
6387 const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end);
6392 ret = (ELEMENT_TYPE *) lookup(parser, &dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
6396 poolDiscard(&dtd->pool);
6398 poolFinish(&dtd->pool);