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(char * entity_Name, 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
symbol_table = new Symbol_Table();
37
SimpleEntity("lt", "<");
38
SimpleEntity("gt", ">");
39
SimpleEntity("amp", "&");
40
SimpleEntity("quot", "\"");
41
SimpleEntity("apos", "'");
45
Model_Info::~Model_Info() {
48
int Model_Info::getOrInsertGlobalElement(int elem_nameID) {
49
int elemID = GlobalElementTable[elem_nameID];
51
GlobalElementTable[elem_nameID]=++(globalElementCount);
52
elemID = globalElementCount;
54
ElementAttributeData.push_back(vector<ATT_info *>());
59
int Model_Info::getOrInsertGlobalAttName(int att_nameID){
61
int attID = GlobalAttributeTable[att_nameID];
63
GlobalAttributeTable[att_nameID]=++(globalAttributeCount);
64
attID = globalAttributeCount;