Home | History | Annotate | Download | only in lib

Lines Matching defs: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
2286 DTD * const dtd = _dtd;
2367 name = poolStoreString(&dtd->pool, enc,
2372 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
2373 poolDiscard(&dtd->pool);
2378 if (!dtd->hasParamEntityRefs || dtd->standalone) {
2748 DTD * const dtd = _dtd; /* save one level of indirection */
2762 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, tagNamePtr->str,0);
2764 const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
2767 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, name,
2959 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0);
3050 else if (dtd->defaultPrefix.binding) {
3051 binding = dtd->defaultPrefix.binding;
3825 DTD * const dtd = _dtd;
3933 &dtd->paramEntities,
3939 dtd->hasParamEntityRefs = XML_TRUE;
3960 if (dtd->keepProcessing && declEntity) {
3961 XML_Char *tem = poolStoreString(&dtd->pool,
3969 poolFinish(&dtd->pool);
3987 XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
3988 dtd->hasParamEntityRefs = XML_TRUE;
3991 &dtd->paramEntities,
3998 dtd->paramEntityRead = XML_FALSE;
4005 if (dtd->paramEntityRead) {
4006 if (!dtd->standalone &&
4011 /* if we didn't read the foreign DTD then this means that there
4012 is no external subset and we must reset dtd->hasParamEntityRefs
4015 dtd->hasParamEntityRefs = hadParamEntityRefs;
4016 /* end of DTD - no need to update dtd->keepProcessing */
4029 last chance to read the foreign DTD
4032 XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
4033 dtd->hasParamEntityRefs = XML_TRUE;
4035 ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities,
4041 dtd->paramEntityRead = XML_FALSE;
4048 if (dtd->paramEntityRead) {
4049 if (!dtd->standalone &&
4054 /* if we didn't read the foreign DTD then this means that there
4055 is no external subset and we must reset dtd->hasParamEntityRefs
4058 dtd->hasParamEntityRefs = hadParamEntityRefs;
4059 /* end of DTD - no need to update dtd->keepProcessing */
4104 if (dtd->keepProcessing && attlistDeclHandler)
4109 if (dtd->keepProcessing && attlistDeclHandler) {
4129 if (dtd->keepProcessing) {
4156 if (dtd->keepProcessing) {
4162 &dtd->pool);
4165 attVal = poolStart(&dtd->pool);
4166 poolFinish(&dtd->pool);
4193 if (dtd->keepProcessing) {
4198 declEntity->textPtr = poolStart(&dtd->entityValuePool);
4199 declEntity->textLen = (int)(poolLength(&dtd->entityValuePool));
4200 poolFinish(&dtd->entityValuePool);
4213 poolDiscard(&dtd->entityValuePool);
4222 dtd->hasParamEntityRefs = XML_TRUE;
4238 if (!dtd->standalone
4250 &dtd->paramEntities,
4260 if (dtd->keepProcessing && declEntity) {
4261 declEntity->systemId = poolStoreString(&dtd->pool, enc,
4267 poolFinish(&dtd->pool);
4273 if (dtd->keepProcessing && declEntity && entityDeclHandler) {
4287 if (dtd->keepProcessing && declEntity) {
4288 declEntity->notation = poolStoreString(&dtd->pool, enc, s, next);
4291 poolFinish(&dtd->pool);
4321 if (dtd->keepProcessing) {
4322 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
4325 declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name,
4330 poolDiscard(&dtd->pool);
4334 poolFinish(&dtd->pool);
4346 poolDiscard(&dtd->pool);
4353 if (dtd->keepProcessing) {
4354 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
4357 declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities,
4362 poolDiscard(&dtd->pool);
4366 poolFinish(&dtd->pool);
4378 poolDiscard(&dtd->pool);
4477 if (dtd->scaffIndex) {
4478 int *temp = (int *)REALLOC(dtd->scaffIndex,
4482 dtd->scaffIndex = temp;
4492 if (dtd->in_eldecl) {
4496 dtd->scaffIndex[dtd->scaffLevel] = myindex;
4497 dtd->scaffLevel++;
4498 dtd->scaffold[myindex].type = XML_CTYPE_SEQ;
4507 if (dtd->in_eldecl && elementDeclHandler)
4513 if (dtd->in_eldecl
4515 && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4518 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4528 dtd->hasParamEntityRefs = XML_TRUE;
4530 dtd->keepProcessing = dtd->standalone;
4534 name = poolStoreString(&dtd->pool, enc,
4539 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
4540 poolDiscard(&dtd->pool);
4546 (dtd->standalone
4548 : !dtd->hasParamEntityRefs)) {
4555 dtd->keepProcessing = dtd->standalone;
4576 dtd->paramEntityRead = XML_FALSE;
4588 if (!dtd->paramEntityRead) {
4589 dtd->keepProcessing = dtd->standalone;
4594 dtd->keepProcessing = dtd->standalone;
4599 if (!dtd->standalone &&
4612 dtd->scaffLevel = 0;
4613 dtd->scaffCount = 0;
4614 dtd->in_eldecl = XML_TRUE;
4621 if (dtd->in_eldecl) {
4637 dtd->in_eldecl = XML_FALSE;
4642 if (dtd->in_eldecl) {
4643 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4662 if (dtd->in_eldecl) {
4672 dtd->scaffold[myindex].type = XML_CTYPE_NAME;
4673 dtd->scaffold[myindex].quant = quant;
4678 dtd->scaffold[myindex].name = name;
4681 dtd->contentStringLen += nameLen;
4699 if (dtd->in_eldecl) {
4702 dtd->scaffLevel--;
4703 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant;
4704 if (dtd->scaffLevel == 0) {
4712 dtd->in_eldecl = XML_FALSE;
4713 dtd->contentStringLen = 0;
4741 if (dtd->keepProcessing && entityDeclHandler)
4749 if (dtd->keepProcessing && attlistDeclHandler)
4990 DTD * const dtd = _dtd; /* save one level of indirection */
5063 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
5068 if (pool == &dtd->pool) /* are we called from prolog? */
5073 (dtd->standalone
5075 : !dtd->hasParamEntityRefs);
5077 checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone;
5141 DTD * const dtd = _dtd; /* save one level of indirection */
5142 STRING_POOL *pool = &(dtd->entityValuePool);
5172 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
5181 dtd->keepProcessing = dtd->standalone;
5192 dtd->paramEntityRead = XML_FALSE;
5204 if (!dtd->paramEntityRead)
5205 dtd->keepProcessing = dtd->standalone;
5208 dtd->keepProcessing = dtd->standalone;
5451 DTD * const dtd = _dtd; /* save one level of indirection */
5458 if (!poolAppendChar(&dtd->pool, *s))
5461 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5463 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
5467 if (prefix->name == poolStart(&dtd->pool))
5468 poolFinish(&dtd->pool);
5470 poolDiscard(&dtd->pool);
5482 DTD * const dtd = _dtd; /* save one level of indirection */
5485 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5487 name = poolStoreString(&dtd->pool, enc, start, end);
5492 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, name, sizeof(ATTRIBUTE_ID));
5496 poolDiscard(&dtd->pool);
5498 poolFinish(&dtd->pool);
5508 id->prefix = &dtd->defaultPrefix;
5510 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, name + 6, sizeof(PREFIX));
5520 if (!poolAppendChar(&dtd->pool, name[j]))
5523 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5525 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
5529 if (id->prefix->name == poolStart(&dtd->pool))
5530 poolFinish(&dtd->pool);
5532 poolDiscard(&dtd->pool);
5546 DTD * const dtd = _dtd; /* save one level of indirection */
5550 if (dtd->defaultPrefix.binding) {
5555 len = dtd->defaultPrefix.binding->uriLen;
5559 if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i]))
5564 hashTableIterInit(&iter, &(dtd->prefixes));
5591 hashTableIterInit(&iter, &(dtd->generalEntities));
5615 DTD * const dtd = _dtd; /* save one level of indirection */
5623 e = (ENTITY *)lookup(parser, &dtd->generalEntities, poolStart(&tempPool), 0);
5634 prefix = &dtd->defaultPrefix;
5638 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&tempPool),
5643 prefix->name = poolCopyString(&dtd->pool, prefix->name);
5695 static DTD *
5698 DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD));
5729 dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms)
5771 dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms)
5798 /* Do a deep copy of the DTD. Return 0 for out of memory, non-zero otherwise.
5799 The new DTD has already been initialized.
5802 dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
6336 DTD * const dtd = _dtd; /* save one level of indirection */
6340 if (!dtd->scaffIndex) {
6341 dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int));
6342 if (!dtd->scaffIndex)
6344 dtd
6347 if (dtd->scaffCount >= dtd->scaffSize) {
6349 if (dtd->scaffold) {
6351 REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
6354 dtd->scaffSize *= 2;
6361 dtd->scaffSize = INIT_SCAFFOLD_ELEMENTS;
6363 dtd->scaffold = temp;
6365 next = dtd->scaffCount++;
6366 me = &dtd->scaffold[next];
6367 if (dtd->scaffLevel) {
6368 CONTENT_SCAFFOLD *parent = &dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel-1]];
6370 dtd->scaffold[parent->lastchild].nextsib = next;
6388 DTD * const dtd = _dtd; /* save one level of indirection */
6389 dest->type = dtd->scaffold[src_node].type;
6390 dest->quant = dtd->scaffold[src_node].quant;
6394 src = dtd->scaffold[src_node].name;
6407 dest->numchildren = dtd->scaffold[src_node].childcnt;
6410 for (i = 0, cn = dtd->scaffold[src_node].firstchild;
6412 i++, cn = dtd->scaffold[cn].nextsib) {
6422 DTD * const dtd = _dtd; /* save one level of indirection */
6426 int allocsize = (dtd->scaffCount * sizeof(XML_Content)
6427 + (dtd->contentStringLen * sizeof(XML_Char)));
6433 str = (XML_Char *) (&ret[dtd->scaffCount]);
6446 DTD * const dtd = _dtd; /* save one level of indirection */
6447 const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end);
6452 ret = (ELEMENT_TYPE *) lookup(parser, &dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
6456 poolDiscard(&dtd->pool);
6458 poolFinish(&dtd->pool);