Home | History | Annotate | Download | only in lib

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
2251 DTD * const dtd = _dtd;
2332 name = poolStoreString(&dtd->pool, enc,
2337 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
2338 poolDiscard(&dtd->pool);
2343 if (!dtd->hasParamEntityRefs || dtd->standalone) {
2713 DTD * const dtd = _dtd; /* save one level of indirection */
2727 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, tagNamePtr->str,0);
2729 const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
2732 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, name,
2924 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0);
3015 else if (dtd->defaultPrefix.binding) {
3016 binding = dtd->defaultPrefix.binding;
3790 DTD * const dtd = _dtd;
3898 &dtd->paramEntities,
3904 dtd->hasParamEntityRefs = XML_TRUE;
3925 if (dtd->keepProcessing && declEntity) {
3926 XML_Char *tem = poolStoreString(&dtd->pool,
3934 poolFinish(&dtd->pool);
3952 XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
3953 dtd->hasParamEntityRefs = XML_TRUE;
3956 &dtd->paramEntities,
3963 dtd->paramEntityRead = XML_FALSE;
3970 if (dtd->paramEntityRead) {
3971 if (!dtd->standalone &&
3976 /* if we didn't read the foreign DTD then this means that there
3977 is no external subset and we must reset dtd->hasParamEntityRefs
3980 dtd->hasParamEntityRefs = hadParamEntityRefs;
3981 /* end of DTD - no need to update dtd->keepProcessing */
3994 last chance to read the foreign DTD
3997 XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
3998 dtd->hasParamEntityRefs = XML_TRUE;
4000 ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities,
4006 dtd->paramEntityRead = XML_FALSE;
4013 if (dtd->paramEntityRead) {
4014 if (!dtd->standalone &&
4019 /* if we didn't read the foreign DTD then this means that there
4020 is no external subset and we must reset dtd->hasParamEntityRefs
4023 dtd->hasParamEntityRefs = hadParamEntityRefs;
4024 /* end of DTD - no need to update dtd->keepProcessing */
4069 if (dtd->keepProcessing && attlistDeclHandler)
4074 if (dtd->keepProcessing && attlistDeclHandler) {
4094 if (dtd->keepProcessing) {
4121 if (dtd->keepProcessing) {
4127 &dtd->pool);
4130 attVal = poolStart(&dtd->pool);
4131 poolFinish(&dtd->pool);
4158 if (dtd->keepProcessing) {
4163 declEntity->textPtr = poolStart(&dtd->entityValuePool);
4164 declEntity->textLen = (int)(poolLength(&dtd->entityValuePool));
4165 poolFinish(&dtd->entityValuePool);
4178 poolDiscard(&dtd->entityValuePool);
4187 dtd->hasParamEntityRefs = XML_TRUE;
4203 if (!dtd->standalone
4215 &dtd->paramEntities,
4225 if (dtd->keepProcessing && declEntity) {
4226 declEntity->systemId = poolStoreString(&dtd->pool, enc,
4232 poolFinish(&dtd->pool);
4238 if (dtd->keepProcessing && declEntity && entityDeclHandler) {
4252 if (dtd->keepProcessing && declEntity) {
4253 declEntity->notation = poolStoreString(&dtd->pool, enc, s, next);
4256 poolFinish(&dtd->pool);
4286 if (dtd->keepProcessing) {
4287 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
4290 declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name,
4295 poolDiscard(&dtd->pool);
4299 poolFinish(&dtd->pool);
4311 poolDiscard(&dtd->pool);
4318 if (dtd->keepProcessing) {
4319 const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
4322 declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities,
4327 poolDiscard(&dtd->pool);
4331 poolFinish(&dtd->pool);
4343 poolDiscard(&dtd->pool);
4442 if (dtd->scaffIndex) {
4443 int *temp = (int *)REALLOC(dtd->scaffIndex,
4447 dtd->scaffIndex = temp;
4457 if (dtd->in_eldecl) {
4461 dtd->scaffIndex[dtd->scaffLevel] = myindex;
4462 dtd->scaffLevel++;
4463 dtd->scaffold[myindex].type = XML_CTYPE_SEQ;
4472 if (dtd->in_eldecl && elementDeclHandler)
4478 if (dtd->in_eldecl
4480 && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4483 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4493 dtd->hasParamEntityRefs = XML_TRUE;
4495 dtd->keepProcessing = dtd->standalone;
4499 name = poolStoreString(&dtd->pool, enc,
4504 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
4505 poolDiscard(&dtd->pool);
4511 (dtd->standalone
4513 : !dtd->hasParamEntityRefs)) {
4520 dtd->keepProcessing = dtd->standalone;
4541 dtd->paramEntityRead = XML_FALSE;
4553 if (!dtd->paramEntityRead) {
4554 dtd->keepProcessing = dtd->standalone;
4559 dtd->keepProcessing = dtd->standalone;
4564 if (!dtd->standalone &&
4577 dtd->scaffLevel = 0;
4578 dtd->scaffCount = 0;
4579 dtd->in_eldecl = XML_TRUE;
4586 if (dtd->in_eldecl) {
4602 dtd->in_eldecl = XML_FALSE;
4607 if (dtd->in_eldecl) {
4608 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
4627 if (dtd->in_eldecl) {
4637 dtd->scaffold[myindex].type = XML_CTYPE_NAME;
4638 dtd->scaffold[myindex].quant = quant;
4643 dtd->scaffold[myindex].name = name;
4646 dtd->contentStringLen += nameLen;
4664 if (dtd->in_eldecl) {
4667 dtd->scaffLevel--;
4668 dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant;
4669 if (dtd->scaffLevel == 0) {
4677 dtd->in_eldecl = XML_FALSE;
4678 dtd->contentStringLen = 0;
4706 if (dtd->keepProcessing && entityDeclHandler)
4714 if (dtd->keepProcessing && attlistDeclHandler)
4955 DTD * const dtd = _dtd; /* save one level of indirection */
5028 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
5033 if (pool == &dtd->pool) /* are we called from prolog? */
5038 (dtd->standalone
5040 : !dtd->hasParamEntityRefs);
5042 checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone;
5106 DTD * const dtd = _dtd; /* save one level of indirection */
5107 STRING_POOL *pool = &(dtd->entityValuePool);
5137 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
5146 dtd->keepProcessing = dtd->standalone;
5157 dtd->paramEntityRead = XML_FALSE;
5169 if (!dtd->paramEntityRead)
5170 dtd->keepProcessing = dtd->standalone;
5173 dtd->keepProcessing = dtd->standalone;
5416 DTD * const dtd = _dtd; /* save one level of indirection */
5423 if (!poolAppendChar(&dtd->pool, *s))
5426 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5428 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
5432 if (prefix->name == poolStart(&dtd->pool))
5433 poolFinish(&dtd->pool);
5435 poolDiscard(&dtd->pool);
5447 DTD * const dtd = _dtd; /* save one level of indirection */
5450 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5452 name = poolStoreString(&dtd->pool, enc, start, end);
5457 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, name, sizeof(ATTRIBUTE_ID));
5461 poolDiscard(&dtd->pool);
5463 poolFinish(&dtd->pool);
5473 id->prefix = &dtd->defaultPrefix;
5475 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, name + 6, sizeof(PREFIX));
5485 if (!poolAppendChar(&dtd->pool, name[j]))
5488 if (!poolAppendChar(&dtd->pool, XML_T('\0')))
5490 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
5494 if (id->prefix->name == poolStart(&dtd->pool))
5495 poolFinish(&dtd->pool);
5497 poolDiscard(&dtd->pool);
5511 DTD * const dtd = _dtd; /* save one level of indirection */
5515 if (dtd->defaultPrefix.binding) {
5520 len = dtd->defaultPrefix.binding->uriLen;
5524 if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i]))
5529 hashTableIterInit(&iter, &(dtd->prefixes));
5556 hashTableIterInit(&iter, &(dtd->generalEntities));
5580 DTD * const dtd = _dtd; /* save one level of indirection */
5588 e = (ENTITY *)lookup(parser, &dtd->generalEntities, poolStart(&tempPool), 0);
5599 prefix = &dtd->defaultPrefix;
5603 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&tempPool),
5608 prefix->name = poolCopyString(&dtd->pool, prefix->name);
5660 static DTD *
5663 DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD));
5694 dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms)
5736 dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms)
5763 /* Do a deep copy of the DTD. Return 0 for out of memory, non-zero otherwise.
5764 The new DTD has already been initialized.
5767 dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
6301 DTD * const dtd = _dtd; /* save one level of indirection */
6305 if (!dtd->scaffIndex) {
6306 dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int));
6307 if (!dtd->scaffIndex)
6309 dtd->scaffIndex[0] = 0;
6312 if (dtd->scaffCount >= dtd->scaffSize) {
6314 if (dtd->scaffold) {
6316 REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
6319 dtd->scaffSize *= 2;
6326 dtd->scaffSize = INIT_SCAFFOLD_ELEMENTS;
6328 dtd->scaffold = temp;
6330 next = dtd->scaffCount++;
6331 me = &dtd->scaffold[next];
6332 if (dtd->scaffLevel) {
6333 CONTENT_SCAFFOLD *parent = &dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel-1]];
6335 dtd->scaffold[parent->lastchild].nextsib = next;
6353 DTD * const dtd = _dtd; /* save one level of indirection */
6354 dest->type = dtd->scaffold[src_node].type;
6355 dest->quant = dtd->scaffold[src_node].quant;
6359 src = dtd->scaffold[src_node].name;
6372 dest->numchildren = dtd->scaffold[src_node].childcnt;
6375 for (i = 0, cn = dtd->scaffold[src_node].firstchild;
6377 i++, cn = dtd->scaffold[cn].nextsib) {
6387 DTD * const dtd = _dtd; /* save one level of indirection */
6391 int allocsize = (dtd->scaffCount * sizeof(XML_Content)
6392 + (dtd->contentStringLen * sizeof(XML_Char)));
6398 str = (XML_Char *) (&ret[dtd->scaffCount]);
6411 DTD * const dtd = _dtd; /* save one level of indirection */
6412 const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end);
6417 ret = (ELEMENT_TYPE *) lookup(parser, &dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
6421 poolDiscard(&dtd->pool);
6423 poolFinish(&dtd->pool);