1
/* xmlmodel.c - XML Model Processor
2
Copyright (c) 2007, 2008 Robert D. Cameron
3
Licensed to the public under the Open Software License 3.0.
4
Licensed to International Characters, Inc., under the Academic
9
#include "multiliteral.h"
12
void Model_Info::SimpleEntity(const char * entity_Name, const char * replText) {
14
int entity_NameID = symbol_table->Insert_Name(entity_Name, strlen(entity_Name));
15
int entityID = GlobalGEntityTable[entity_NameID];
17
GEntity_info * this_info = new GEntity_info;
18
GlobalGEntityTable[entity_NameID]=++(globalGEntityCount);
19
entityID = globalGEntityCount;
21
this_info->globalGEntity_id = entityID;
22
this_info->is_external = false;
23
this_info->ReplacementText = replText;
24
this_info->systemLiteral = NULL;
25
this_info->pubidLiteral = NULL;
26
this_info->NDataName = NULL;
27
this_info->is_simple = true;
29
GEntityData.push_back(this_info);
32
Model_Info::Model_Info() {
33
ElementAttributeData.push_back(vector<ATT_info *>());
34
globalElementCount = 0;
35
globalAttributeCount = 0;
36
globalNotationCount = 0;
37
globalGEntityCount = 0;
38
globalPEntityCount = 0;
40
symbol_table = new Symbol_Table();
41
SimpleEntity("lt", "<");
42
SimpleEntity("gt", ">");
43
SimpleEntity("amp", "&");
44
SimpleEntity("quot", "\"");
45
SimpleEntity("apos", "'");
49
Model_Info::~Model_Info() {
52
int Model_Info::getOrInsertGlobalElement(int elem_nameID) {
53
int elemID = GlobalElementTable[elem_nameID];
55
GlobalElementTable[elem_nameID]=++(globalElementCount);
56
elemID = globalElementCount;
58
ElementAttributeData.push_back(vector<ATT_info *>());
63
int Model_Info::getOrInsertGlobalAttName(int att_nameID){
65
int attID = GlobalAttributeTable[att_nameID];
67
GlobalAttributeTable[att_nameID]=++(globalAttributeCount);
68
attID = globalAttributeCount;